public static string ProductionOrder(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { VProduceOrder vpo = new VProduceOrder(); B_YqSaleOrder bso = bsob.Query(" and sid='" + sid + "'"); CB_OrderFlow cof = bwfb.QueryAttrExWorkFlow(sid, "sc"); B_OrderFacotory bof = bofb.Query(" and sid='" + sid + "'"); vpo.code = bso.scode; vpo.ycode = bso.ycode; vpo.customer = bso.customer; vpo.address = bso.address; vpo.dname = bso.dname; vpo.otype = bso.otype; vpo.fname = bof == null ? "" : bof.dname; vpo.scdate = cof.edate; vpo.overdate = bof == null ? "" : CommonBll.GetBdate(bof.overdate); vpo.bz = bso.remark; r = js.Serialize(vpo); } else { r = iv.badstr; } return(r); }
public static string SaveFactory(string bcode, string fcode, string fline, string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { int dn = 0; Sys_Depment sd = sdb.Query(" and dcode='" + fcode + "'"); B_OrderFacotory bf = new B_OrderFacotory(); B_YqAfterSaleOrder baso = bsob.Query(" and sid='" + sid + "'"); B_OrderFacotory bof = bofb.Query(" and sid='" + sid + "'"); List <Sys_ProduceCyc> lc = spcb.QueryCheckList(" and emcode='0006' and dcode='" + fcode + "'"); if (lc != null) { dn = lc[0].cnum; } bf.dname = sd != null ? sd.dname : ""; bf.dcode = fcode; bf.maker = iv.u.ename; bf.sid = sid; bf.overdate = DateTime.Now.AddDays(dn).ToString("yyyy-MM-dd"); bf.otype = baso == null ? "" : baso.otype; bf.cdate = DateTime.Now.ToString(); if (bof != null) { if (bofb.Update(bf)) { r = "S"; bppb.SetProduceProcess(sid, fline); BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(sid, bcode, "1", "分单"); //bcpb.OrderCgComputePrice(sid); } else { r = "F"; } } else { if (bofb.Add(bf) > 0) { r = "S"; bppb.SetProduceProcess(sid, fline); BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(sid, bcode, "1", "分单"); //bcpb.OrderCgComputePrice(sid); } else { r = "F"; } } } else { r = iv.badstr; } return(r); }
public static string FixOrder(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { VFixOrder vfo = new VFixOrder(); B_SaleOrder bso = bsob.Query(" and osid='" + sid + "'"); B_OrderFacotory bof = bofb.Query(" and sid='" + sid + "'"); CB_OrderState cos = cosb.Query(" and sid='" + sid + "'"); string zt = ""; if (cos != null) { if (cos.ifixed == 0) { zt = "未安装"; } if (cos.ifixed == 1) { zt = "部分安装"; } if (cos.ifixed == 2) { zt = "已安装"; } } vfo.code = bso.scode; vfo.ycode = bso.oscode; vfo.wcode = bso.wcode; vfo.otype = bso.otype; vfo.customer = bso.customer; vfo.telephone = bso.telephone; vfo.address = bso.address; vfo.dname = bso.dname; vfo.city = bso.city; vfo.gzname = bso.gzname; vfo.gztelephone = bso.gztelephone; vfo.azzt = zt; vfo.bz = bso.remark; r = js.Serialize(vfo); } else { r = iv.badstr; } return(r); }
public static string OutnHouseOrder(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { VInHouseOrder vpo = new VInHouseOrder(); B_SaleOrder bso = bsob.Query(" and sid='" + sid + "'"); B_OrderFacotory bof = bofb.Query(" and sid='" + sid + "'"); CB_OrderState cos = cosb.Query(" and sid='" + sid + "'"); int bnum = bohrb.GetRecordCount(" sid='" + sid + "'"); string zt = ""; if (cos != null) { if (cos.istoredeliver == 0) { zt = "未发库"; } if (cos.istoredeliver == 1) { zt = "部分发库"; } if (cos.istoredeliver == 2) { zt = "全部发库"; } } vpo.code = bso.scode; vpo.ycode = bso.oscode; vpo.customer = bso.customer; vpo.address = bso.address; vpo.dname = bso.dname; vpo.fname = bof == null ? "" : bof.dname; vpo.bz = bso.remark; vpo.city = bso.city; vpo.telephone = bso.telephone; vpo.bnum = bnum.ToString(); vpo.zt = zt; r = js.Serialize(vpo); } else { r = iv.badstr; } return(r); }
public static string SaveFactory(string bcode, string fcode, string fdate, string sid, string emcode) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { // int dn = 0; Sys_Depment sd = sdb.Query(" and dcode='" + fcode + "'"); B_OrderFacotory bf = new B_OrderFacotory(); B_OrderFacotory bof = bofb.Query(" and sid='" + sid + "'"); bf.dname = sd != null ? sd.dname : ""; bf.dcode = fcode; bf.maker = iv.u.ename; bf.sid = sid; bf.overdate = CommonBll.GetBdate(fdate); bf.fdate = DateTime.Now.ToString(); bf.otype = ""; bf.cdate = DateTime.Now.ToString(); if (bof != null) { if (bofb.Update(bf)) { r = "S"; //if (fline != "") //{ // bppb.SetProduceProcess(sid, fline); //} //bcpb.OrderCgComputePrice(sid); BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(sid, bcode, "1", "分单"); } else { r = "F"; } } else { if (bofb.Add(bf) > 0) { r = "S"; //if (fline != "") //{ // bppb.SetProduceProcess(sid, fline); //} //bcpb.OrderCgComputePrice(sid); BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(sid, bcode, "1", "分单"); } else { r = "F"; } } bcnof.CreateNewOrders(sid, emcode); } else { r = iv.badstr; } return(r); }