public static string ProcessOver(string id) { string r = ""; BusiWorkFlowBll snsb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { CB_ProductionProcess p = new CB_ProductionProcess(); p.id = Convert.ToInt32(id); p.odate = DateTime.Now.ToString(); p.gstate = 1; CB_ProductionProcess pp = cbppb.Query(" and id=" + id + ""); if (cbppb.Update(p)) { //if (pp.jtype == "h") //{ // cosb.UpState(pp.sid, "ifactorydeliver", 1); //} r = "S"; } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static string FireEventBtnAgr(string sid, string bcode, string bstate, string bms) { string r = ""; Sys_ButtonBll sbb = new Sys_ButtonBll(); BusiWorkFlowBll bwfb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_Button sbt = sbb.Query(" and bcode='" + bcode + "'"); if (sbt != null) { r = bwfb.FireEventBtnArg(sid, sbt, Convert.ToInt32(bstate), bms, iv.u.ename); } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static string FireGeneralPageBtn(string sid, string bcode, string bms) { string r = ""; Sys_ButtonBll sbb = new Sys_ButtonBll(); BusiWorkFlowBll bwfb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_Button sbt = sbb.Query(" and bcode='" + bcode + "'"); if (sbt != null) { if (bwfb.FireGeneralPageBtn(sid, sbt, bms, iv.u.ename) > 0) { r = "S"; } else { r = "F"; } } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static string RecoverProcess(string sid) { string r = ""; BusiWorkFlowBll snsb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { CB_ProcessRecord cpr = new CB_ProcessRecord(); CB_OrderProduceProcess p = coppb.Query(" and id=" + sid + ""); cpr.cdate = DateTime.Now.ToString(); cpr.jdname = p.jdname; cpr.jid = p.id; cpr.maker = iv.u.ename; cpr.rtext = p.jdname + "恢复生产"; cpr.sid = p.sid; cprb.Add(cpr); if (coppb.UpState(sid, 0)) { r = "S"; } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static ArrayList QueryFlowLine(string emcode) { ArrayList r = new ArrayList(); BusiWorkFlowBll snsb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r.Add(iv.badstr); List <Sys_WorkEvent> lsw = snsb.QuerySingleWorkFlow(emcode); if (lsw != null) { foreach (Sys_WorkEvent w in lsw) { ArrayList al = new ArrayList(); al.Add(w.wcode); al.Add(w.wname); r.Add(al); } } } else { r.Add(iv.badstr); } return(r); }
public static string GetOverFlowPoint(string sid, string emcode) { string r = ""; BusiWorkFlowBll snsb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r = snsb.QueryOverFlowPoint(sid, emcode); } else { r = iv.badstr; } return(r); }
public static string SaveLongTime(string id, string ldate, string remark) { string r = ""; BusiWorkFlowBll snsb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { CB_ProcessRecord cpr = new CB_ProcessRecord(); CB_OrderProduceProcess p = coppb.Query(" and id=" + id + ""); DateTime d1 = Convert.ToDateTime(ldate); DateTime d2 = Convert.ToDateTime(CommonBll.GetBdate(p.ydate)); TimeSpan ts = d1 - d2; int d = ts.Days; cpr.cdate = DateTime.Now.ToString(); cpr.jdname = p.jdname; cpr.jid = p.id; cpr.maker = iv.u.ename; cpr.rtext = p.jdname + "预计完成日期" + p.ydate + "延期到" + ldate + ";延期说明:" + remark; cpr.sid = p.sid; cprb.Add(cpr); List <CB_OrderProduceProcess> plist = coppb.QueryList(" and id>=" + p.id + " and sid='" + p.sid + "'"); if (plist != null) { foreach (CB_OrderProduceProcess cp in plist) { cp.ydate = Convert.ToDateTime(cp.ydate).AddDays(d).ToString(); coppb.SetLongTime(cp); } } if (coppb.UpState(id, -1)) { r = "S"; } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static string QueryProceeLine(string sid) { string r = ""; BusiWorkFlowBll snsb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r = bppb.GetProduceOrder(sid); r = r + bppb.GetOrderProcess(sid); r = r + bppb.GetProduceProcess(sid); } else { r = iv.badstr; } return(r); }
public static ArrayList BatchFireEventBtn(string sid, string bcode, string bstate, string bms) { ArrayList r = new ArrayList(); string bstr = ""; Sys_ButtonBll sbb = new Sys_ButtonBll(); BusiWorkFlowBll bwfb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_Button sbt = sbb.Query(" and bcode='" + bcode + "'"); if (sbt != null) { r.Add("S"); string[] sids = sid.Split(';'); if (sids.Length > 0) { foreach (string id in sids) { if (bwfb.FireEventBtn(id, sbt, Convert.ToInt32(bstate), bms, iv.u.ename) > 0) { } else { bstr = bstr + id + ";"; } } } if (bstr.Length > 1) { r.Add(bstr.Substring(0, bstr.Length - 1)); } } else { r.Add("F"); } } else { r.Add(iv.badstr); } return(r); }
public static string MBatchFireEventBtn(string sid, string bms) { string r = ""; Sys_ButtonBll sbb = new Sys_ButtonBll(); BusiWorkFlowBll bwfb = new BusiWorkFlowBll(); CB_OrderFlowBll cofb = new CB_OrderFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { string[] sids = sid.Split(';'); if (sids.Length > 0) { foreach (string id in sids) { string wcode = cofb.QueryCurWorkFlow(id); Sys_Button sbt = sbb.Query(" and wcode='" + wcode + "' and battr='T'"); try { if (bwfb.FireEventBtn(id, sbt, 1, bms, iv.u.ename) > 0) { r = "S"; } } catch { r = "F"; } } } } else { r = iv.badstr;; } return(r); }
public static string UnUserFireEventBtn(string sid, string bcode, string bstate, string bms) { string r = ""; Sys_ButtonBll sbb = new Sys_ButtonBll(); BusiWorkFlowBll bwfb = new BusiWorkFlowBll(); Sys_Button sbt = sbb.Query(" and bcode='" + bcode + "'"); if (sbt != null) { if (bwfb.FireEventBtn(sid, sbt, Convert.ToInt32(bstate), bms, "admin") > 0) { r = "S"; } else { r = "F"; } } else { r = "F"; } return(r); }
public static string SaveCustomerOrder(string address, string citycode, string cityname, string cmoney, string colortype, string distype, string customer, string gzname, string gztelephone, string lxtype, string mname, string otype, string remark, string shopcode, string shopname, string sid, string source, string telephone, string wcode, string yxdate) { string r = ""; BusiWorkFlowBll bwfb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_SaleDiscount ssd = ssdb.Query(" and dcode='" + distype + "'"); B_CustormOrder bco = new B_CustormOrder(); bco.ccode = ""; bco.wcode = wcode; bco.cmoney = Convert.ToDecimal(cmoney); bco.customer = customer; bco.telephone = telephone; bco.community = ""; bco.address = address; bco.aname = ""; bco.acode = ""; bco.dname = shopname; bco.dcode = shopcode; bco.e_city = cityname; bco.e_citycode = citycode; bco.e_citytype = ""; bco.gzname = gzname; bco.gztelephone = gztelephone; bco.saletelephone = ""; bco.otype = otype; bco.state = false; bco.mname = mname; bco.source = source; bco.ps = remark; bco.maker = iv.u.ename; bco.cdate = DateTime.Now.ToString(); bco.istax = false; bco.isdf = false; bco.yxdate = CommonBll.GetBdate(yxdate); bco.lxtype = lxtype; bco.colorpane = colortype; if (distype != "") { bco.disactname = ssd != null ? ssd.dname : ""; bco.disactcode = distype; } else { bco.disactname = ""; bco.disactcode = ""; } if (sid == "") { bco.csid = CommonBll.GetSid(); bco.ccode = cocb.SetCustomerOrderCode(); if (bcob.Add(bco) > 0) { bwfb.CreateWorkFlow(bco.csid, "0001"); r = bco.csid; } else { r = "F"; } } else { bco.csid = sid; if (bcob.Update(bco)) { r = bco.csid; } else { r = "F"; } } } else { r = iv.badstr; } return(r); }
public static string SaveOrder(string address, string azperson, string citycode, string cityname, string clperson, string colorpane, string community, string customer, string emcode, string floor, string maker, string mname, string mtype, string otype, string qbcode, string remark, string saddress, string saletelephone, string shopcode, string shopname, string sid, string source, string telephone, string untype, string ycode, string ydate) { string r = ""; string saddr = ""; BusiWorkFlowBll bwfb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_Depment sd = sdb.Query(" and dcode='" + citycode + "'"); Sys_Depment cd = sdb.Query(" and dcode='" + iv.u.dcode.Substring(0, 8) + "'"); Sys_Area sa = sab.Query(" and acode=(select acode from Sys_RDepmentArea where dcode='" + citycode + "')"); Sys_CityGetAddress scga = scgab.QueryFrist(" and dcode='" + citycode + "'"); B_SaleOrder bco = new B_SaleOrder(); if (scga != null) { saddr = scga.address; } //bco.ccode =cd.dabc + DateTime.Now.ToString("yyyyMMddHHmmss"); //bco.ycode =ycode; bco.wcode = ""; bco.customer = customer; bco.telephone = telephone; bco.community = ""; bco.address = address.Replace(",", ","); if (sa != null) { //bco.aname = sa.aname; //bco.acode = sa.acode; } bco.dname = shopname; bco.dcode = shopcode; bco.city = sd != null ? sd.dname : ""; //bco.citytype = ""; bco.citycode = citycode; bco.gzname = ""; bco.gztelephone = ""; // bco.saletelephone = saletelephone; bco.otype = otype; // bco.state = false; bco.mname = mname; bco.source = source; //bco.ps = remark.Replace(",", ","); bco.maker = maker; // bco.wlcompany = ""; bco.cdate = DateTime.Now.ToString(); bco.istax = false; bco.isdf = false; //bco.lxtype = ""; bco.colorpane = colorpane; // bco.sname = sd.khcode; bco.floor = floor; bco.bdcode = iv.u.dcode.Substring(0, 8); // bco.qbcode = qbcode; bco.clperson = clperson; bco.azperson = azperson; bco.saddress = saddress == "" ? saddr : saddress; bco.ydate = ydate == null?"":ydate; if (sid == "") { CB_OrderState cos = new CB_OrderState(); bco.sid = CommonBll.GetSid(); bco.qtimg = qcb.CreateQtCode(System.Web.HttpContext.Current.Server.MapPath("/UpFile/OrderQt/"), CommonBll.GetHost() + "UIClient/SalesBusiness/DistributorOrder/SaleOrderDetail.htm?Sid=" + bco.sid); if (bsob.Add(bco) > 0) { bwfb.CreateWorkFlow(bco.sid, emcode); cos.sid = bco.sid; cosb.Add(cos); if (!bcb.Exists(" and customer='" + bco.customer + "' and bdcode='" + iv.u.dcode.Substring(0, 8) + "'")) { B_Customer bc = new B_Customer(); bc.dname = bco.dname; bc.dcode = bco.dcode; bc.customer = bco.customer; bc.telephone = bco.telephone; bc.community = bco.community; bc.address = bco.address; bc.cdate = DateTime.Now.ToString(); bc.maker = bco.maker; bc.bdcode = iv.u.dcode.Substring(0, 8); bcb.Add(bc); } r = bco.sid; } else { r = "F"; } } else { bco.sid = sid; if (bsob.Update(bco)) { r = bco.sid; } else { r = "F"; } } } else { r = iv.badstr; } return(r); }
public static string SaveOrder(string address, string azperson, string bcode, string citycode, string cityname, string colorpane, string community, string customer, string emcode, string floor, string gytype, string ismb, string maker, string mname, string mtype, string otype, string qbcode, string remark, string saddress, string saletelephone, string shopcode, string shopname, string sid, string source, string surveyor, string telephone, string ycode) { string r = ""; BusiWorkFlowBll bwfb = new BusiWorkFlowBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_Depment sd = sdb.Query(" and dcode='" + citycode + "'"); Sys_Depment cd = sdb.Query(" and dcode='" + iv.u.dcode.Substring(0, 8) + "'"); B_YqSaleOrder bco = new B_YqSaleOrder(); bco.ccode = cd.dabc + DateTime.Now.ToString("yyyyMMddHHmmss"); bco.ycode = ycode; bco.wcode = ""; bco.customer = customer; bco.telephone = telephone; bco.community = ""; bco.address = address.Replace(",", ","); bco.aname = ""; bco.acode = ""; bco.dname = shopname; bco.dcode = shopcode; bco.city = sd != null ? sd.dname : ""; bco.citytype = ""; bco.citycode = citycode; bco.gzname = ""; bco.gztelephone = ""; bco.saletelephone = saletelephone; bco.mname = mname; bco.source = source; bco.remark = remark.Replace(",", ","); bco.maker = maker; bco.wlcompany = ""; bco.cdate = DateTime.Now.ToString(); bco.istax = false; bco.isdf = false; bco.lxtype = ""; bco.colorpane = colorpane; bco.sname = sd.khcode; bco.floor = floor; bco.ismb = ismb == "1"?true:false; bco.iswj = false; bco.saddress = saddress; bco.gytype = gytype; bco.mtype = "yq"; bco.bdcode = iv.u.dcode.Substring(0, 8); if (sid == "") { CB_OrderState cos = new CB_OrderState(); bco.sid = CommonBll.GetSid(); //bco.qtimg = qcb.CreateUrlQtCode("/UpFile/OrderQt/", CommonBll.GetHost() + "SaleOrderDetail.htm?Sid=", bco.sid); if (bsob.Add(bco) > 0) { bwfb.CreateWorkFlow(bco.sid, emcode); cos.sid = bco.sid; cosb.Add(cos); if (!bcb.Exists(" and customer='" + bco.customer + "' and bdcode='" + iv.u.dcode.Substring(0, 8) + "'")) { B_Customer bc = new B_Customer(); bc.dname = bco.dname; bc.dcode = bco.dcode; bc.customer = bco.customer; bc.telephone = bco.telephone; bc.community = bco.community; bc.address = bco.address; bc.cdate = DateTime.Now.ToString(); bc.maker = bco.maker; bc.bdcode = iv.u.dcode.Substring(0, 8); bcb.Add(bc); } r = bco.sid; } else { r = "F"; } } else { bco.sid = sid; if (bsob.Update(bco)) { r = bco.sid; } else { r = "F"; } } EventBtnDo.FireEventBtn(bco.sid, bcode, "1", "保存订单"); } else { r = iv.badstr; } return(r); }