源码运行没有问题,发布后只有有加放单号pos10105.get_create_billno("POS10115");发布后就没有显示,其它栏也没有显示
if (edit == "new")
{
////新增时默认值
dtfrom = pos10105.getpos10105(docno);
DataRow dr = dtfrom.Tables[0].NewRow();
docno = pos10105.get_create_billno("POS10115");
dr["docno"] = docno;
dr["docdate"] = DateTime.Now;
dr["emplno"] = userno;
dr["emplnoname"] = username;
dr["dept"] = fdeptno;
dr["deptdescription"] = fdeptname;
dr["note"] = "";
dtfrom.Tables[0].Rows.Add(dr);
//string dt = Common.DataToJson.DataToJSON(dtfrom);
//context.Response.Write(dt);
StringBuilder str = new StringBuilder();
str.Append("{docno:'" + docno.ToString() + "'}");
context.Response.Write(str);
}
public string get_create_billno(string as_fbilltype)
{
string str_newfbillno = "";
string ls_fbillno = null;
string ls_fyear1, ls_fmonth1, ls_fmaxbillno = "", ls_fday1;
int ll_no, ll_newno;
DateTime adt_now = DateTime.Now;
ls_fyear1 = adt_now.ToShortDateString().Substring(2, 2);
ls_fmonth1 = adt_now.ToShortDateString().Substring(5, 2);
ls_fday1 = adt_now.ToShortDateString().Substring(8, 2);
ls_fbillno = "RE" + ls_fyear1.PadLeft(2, '0') + ls_fmonth1.PadLeft(2, '0') + ls_fday1.PadLeft(2, '0');
ls_fmaxbillno = DbHelperSQL2.GetFileValues("select max(docno) from pos10105 where docno like '%" + ls_fbillno + "'");
//ls_fmaxbillno = DbHelperSQL2.GetFileValues("select fmaxno from pda10008 where fbillno='POS10105'");
if (ls_fmaxbillno.ToString().Length == 0)
{
ls_fbillno = "RE" + ls_fyear1.PadLeft(2, '0') + ls_fmonth1.PadLeft(2, '0') + ls_fday1.PadLeft(2, '0') + "0001";
}
else
{
ll_no = Convert.ToInt16(ls_fmaxbillno.ToString().Substring(ls_fmaxbillno.Length - 1));
ll_newno = ll_no + 1;
string ls_newno = ll_newno.ToString().PadLeft(4, '0');
ls_fbillno = ls_fbillno + ls_newno;
}
str_newfbillno = ls_fbillno;
return str_newfbillno;
}