public static string InitProduceCyc(string ccode) { string r = ""; Sys_ProduceCyc st = new Sys_ProduceCyc(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (ccode == "") { st.ccode = spcb.CreateCode().ToString().PadLeft(4, '0'); st.cname = ""; st.id = 0; } else { st = spcb.Query(" and ccode='" + ccode + "'"); } r = js.Serialize(st); } else { r = iv.badstr; } return(r); }
public static string QueryFactoryDate(string bdcode, string fcode, string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_ProduceCyc spc = spcb.QueryCheckList(bdcode, fcode, sid); if (spc != null) { r = DateTime.Now.AddDays(spc.cnum).ToString(); } } else { r = iv.badstr; } return(r); }
public static string SaveProduceCyc(string bdcode, string ccode, string cid, string cname, string cnum, string csql, string dcode, string emcode, string otype) { string r = ""; Sys_ProduceCyc sv = new Sys_ProduceCyc(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_Brands sb = sbb.Query(" and pbcode='" + bdcode + "'"); Sys_EventMenu sem = semb.Query(" and emcode='" + emcode + "'"); Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'"); sv.ccode = ccode; sv.cname = cname; sv.csql = csql; sv.cnum = Convert.ToInt32(cnum); if (sb != null) { sv.bdname = sb.pbname; sv.bdcode = sb.pbcode; } if (sem != null) { sv.emname = sem.emname; sv.emcode = emcode; } if (sd != null) { sv.fcode = dcode; sv.fname = sd.dname; } if (iv.u.rcode == "xtgl") { sv.dcode = ""; } else { sv.dcode = iv.u.dcode.Substring(0, 8); } sv.cdate = DateTime.Now.ToString(); sv.maker = iv.u.ename; sv.otype = otype; if (cid == "0") { if (spcb.Add(sv) > 0) { r = "S"; } else { r = "F"; } } else { if (spcb.Update(sv)) { r = "S"; } else { r = "F"; } } } else { r = iv.badstr; } return(r); }