public static string SalePayOperator(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { B_YqSaleOrder bso = bsob.Query(" and sid='" + sid + "'"); VPayOrder vpo = new VPayOrder(); VOrderMoney vm = bomb.DoorOrderMoney(sid, bso.sdiscount, bso.gdiscount, 1); CB_OrderFlow cof = bwfb.QueryAttrExWorkFlow(sid, "bj"); vpo.code = bso.scode; vpo.customer = bso.customer; vpo.dname = bso.dname; vpo.dcode = bso.citycode; vpo.settlment = bso.sname; vpo.bjr = cof != null ? cof.maker : ""; vpo.yingshou = vm.godhjmoney.ToString(); vpo.yishou = vm.pmoney.ToString(); vpo.weishou = (vm.godhjmoney - vm.pmoney).ToString(); vpo.telephone = bso.telephone; r = js.Serialize(vpo); } else { r = iv.badstr; } return(r); }
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 LoadSaleOrder(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { B_YqSaleOrder bco = bsob.Query(" and sid='" + sid + "'"); if (bco != null) { B_CustormOrder bdj = bcob.Query(" and csid='" + bco.csid + "'"); r = js.Serialize(bco); } else { Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'"); B_SaleOrder kco = new B_SaleOrder(); if (sd != null) { if (sd.dattr == "cs") { Sys_DepmentDpt sdd = sddb.Query(" and dcode='" + sd.dcode + "'"); kco.city = sd.dpname; kco.citycode = sd.dpcode; kco.dname = sd.dname; kco.dcode = sd.dcode; kco.stelephone = sdd != null ? sdd.dcontact : ""; } else if (sd.dattr == "dm") { Sys_DepmentDpt sdd = sddb.Query(" and dcode='" + sd.dcode.Substring(0, sd.dcode.Length - 4) + "'"); kco.city = sd.dpname; kco.citycode = sd.dpcode; kco.dname = sd.dname; kco.dcode = sd.dcode; kco.stelephone = sdd != null ? sdd.dcontact : ""; } else { kco.city = ""; kco.citycode = ""; kco.dname = ""; kco.dcode = ""; } } kco.maker = iv.u.ename; r = js.Serialize(kco); } } else { r = iv.badstr; } return(r); }
public static string InHouseOrder(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { VInHouseOrder vpo = new VInHouseOrder(); B_YqSaleOrder 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.istoreget == 0) { zt = "未入库"; } if (cos.istoreget == 1) { zt = "部分入库"; } if (cos.istoreget == 2) { zt = "全部入库"; } } vpo.code = bso.scode; vpo.ycode = bso.ycode; 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 QueryOrderMoney(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { B_YqSaleOrder bco = bsob.Query(" and sid='" + sid + "'"); if (bco != null) { r = js.Serialize(bco); } } else { r = iv.badstr; } return(r); }
public static string SetDiscount(string sid, string dv) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r = "F"; B_SaleOrder bso = bsob.Query(" and sid='" + sid + "'"); if (bso != null) { if (bsob.SetGDiscount(sid, Convert.ToDecimal(dv))) { r = "S"; } } B_YqSaleOrder ybso = ybsob.Query(" and sid='" + sid + "'"); if (ybso != null) { if (ybsob.SetGDiscount(sid, Convert.ToDecimal(dv))) { r = "S"; } } B_AfterSaleOrder baso = basob.Query(" and sid='" + sid + "'"); if (bso != null) { r = "S"; //if (basob.SetGDiscount(sid, Convert.ToDecimal(dv))) //{ //} } } else { r = iv.badstr; } return(r); }
public static string SaveQualityProduction(string sid, string qtype, string qremark, string rowid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { string scode = ""; string precode = ""; B_PartQualityOrder bpqo = new B_PartQualityOrder(); B_YqSaleOrder bso = bsob.Query(" and sid='" + sid + "'"); if (qtype == "s") { bpqo.qstate = 1; } if (qtype == "f") { bpqo.qstate = -1; precode = "F"; } if (bso != null) { scode = bso.scode; } bpqo.cdate = DateTime.Now.ToString(); bpqo.maker = iv.u.ename; bpqo.qcode = scode + "-" + precode + bpqob.QueryQorderNum(" and sid='" + sid + "' and qstate=" + bpqo.qstate + "").ToString(); bpqo.qsid = CommonBll.GetSid(); bpqo.remark = qremark; bpqo.sid = sid; List <B_PartQualityItems> lq = new List <B_PartQualityItems>(); string[] arrow = rowid.ToString().Split(';'); if (arrow.Length > 0) { foreach (string id in arrow) { string idv = ""; string etype = ""; B_PartQualityItems bpi = new B_PartQualityItems(); if (id.IndexOf('-') > -1) { string[] ids = id.Split('-'); idv = ids[0]; etype = ids[1]; } else { idv = id; } B_GroupProduction bgp = bgpb.Query(" and id=" + idv + ""); if (bgp != null) { bpi.cdate = DateTime.Now.ToString(); //if (bgp.ptype == "ms") //{ // B_ProductionItem li = bpib.Query(" and psid='" + bgp.psid + "' and e_ptype='" + etype + "'"); // bpi.deep = li.deep; // bpi.gnum = bgp.gnum; // bpi.height = li.height; // bpi.maker = iv.u.ename; // bpi.pcode = li.pcode; // bpi.pname = li.pname; // bpi.pnum = (int)li.pnum; // bpi.psid = li.psid; // bpi.qsid = bpqo.qsid; // bpi.sid = sid; // bpi.width = li.width; // lq.Add(bpi); //} //else //{ bpi.deep = bgp.deep; bpi.gnum = bgp.gnum; bpi.height = bgp.height; bpi.maker = iv.u.ename; bpi.pcode = bgp.icode; bpi.pname = bgp.iname; bpi.pnum = (int)bgp.inum; bpi.psid = bgp.psid; bpi.qsid = bpqo.qsid; bpi.sid = sid; bpi.width = bgp.width; lq.Add(bpi); //} } } } if (bpqob.SaveQualityOrder(bpqo, lq)) { List <B_GroupProduction> lbpi = bgpb.QueryList(" and sid='" + sid + "' and substring(icode,9,3)<>'004' and psid not in (select psid from B_PartQualityItems where qsid in(select qsid from B_PartQualityOrder where sid='" + sid + "' and qstate=1) ) order by gnum"); if (lbpi == null) { cosb.UpState(sid, "iquality", 2); cosb.UpState(sid, "ifactorydeliver", 2); } r = "S"; } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static string InitAddAfterOrder(string sid, string m) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); B_YqAfterSaleOrder ao = new B_YqAfterSaleOrder(); if (iv.f) { #region//存在原单 if (sid != "") { B_YqAfterSaleOrder aso = basob.Query(" and sid='" + sid + "'"); if (aso != null) { if (m == "a") { ao = aso; } else { aso.osid = aso.sid; aso.sid = ""; aso.id = 0; aso.otype = "售后反馈"; ao = aso; } } B_YqSaleOrder bso = sbs.Query(" and sid='" + sid + "'"); if (bso != null) { ao.id = 0; ao.sid = ""; ao.osid = bso.sid; ao.customer = bso.customer; ao.telephone = bso.telephone; ao.address = bso.address; ao.pcode = bso.scode; ao.dcode = bso.dcode; ao.dname = bso.dname; ao.city = bso.city; ao.citytype = bso.citytype; ao.citycode = bso.citycode; ao.maker = iv.u.ename;; ao.mname = bso.mname; ao.source = ""; ao.aduty = ""; ao.areason = ""; ao.remark = ""; ao.method = ""; ao.otype = "木门反馈"; ao.wlcompany = bso.wlcompany; } } #endregion #region//不存在原单 if (sid == "") { Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'"); ao.id = 0; ao.dcode = iv.u.dcode; ao.dname = iv.u.dname; ao.city = sd.dpname; ao.citytype = ""; ao.citycode = sd.dpcode; ao.maker = iv.u.ename; } #endregion r = js.Serialize(ao); } else { r = iv.badstr; } return(r); }
public static string SetOrderCode(string sid, string code) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r = "F"; B_SaleOrder bso = bsob.Query(" and sid='" + sid + "'"); if (bso != null) { if (bsob.Exists(" and scode='" + code + "' and sid!='" + sid + "'")) { r = "T"; } else { if (bsob.SetOrderCode(sid, code)) { r = "S"; } else { r = "F"; } } } B_YqSaleOrder ybso = ybsob.Query(" and sid='" + sid + "'"); if (ybso != null) { if (ybsob.Exists(" and scode='" + code + "' and sid!='" + sid + "'")) { r = "T"; } else { if (ybsob.SetOrderCode(sid, code)) { r = "S"; } else { r = "F"; } } } B_AfterSaleOrder baso = basob.Query(" and sid='" + sid + "'"); if (baso != null) { if (basob.Exists(" and scode='" + code + "' and sid!='" + sid + "'")) { r = "T"; } else { r = "S"; //if (basob.SetOrderCode(sid, code)) //{ // r = "S"; //} //else //{ // r = "F"; //} } } B_MzSaleOrder bmso = bmsob.Query(" and sid='" + sid + "'"); if (bmso != null) { if (bmsob.Exists(" and scode='" + code + "' and sid!='" + sid + "'")) { r = "T"; } else { if (bmsob.SetOrderCode(sid, code)) { r = "S"; } else { r = "F"; } } } B_SaleMaterielOrder bswo = bswob.Query(" and sid='" + sid + "'"); if (bswo != null) { if (bswob.Exists(" and scode='" + code + "' and sid!='" + sid + "'")) { r = "T"; } else { if (bswob.SetOrderCode(sid, code)) { r = "S"; } 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); }
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_YqSaleOrder bso = bsob.Query(" and sid='" + sid + "'"); B_AfterSaleOrder baso = basob.Query(" and sid='" + sid + "'"); B_OrderFacotory bof = bofb.Query(" and sid='" + sid + "'"); if (bso != null) { string otype = bso.otype == "补单" ? "补单" : "新单"; List <Sys_ProduceCyc> lc = spcb.QueryCheckList(" and emcode='0006' and dcode='" + fcode + "' and otype='" + otype + "'"); if (lc != null) { dn = lc[0].cnum; } } if (baso != null) { string otype = baso.otype == "补单" ? "补单" : "新单"; List <Sys_ProduceCyc> lc = spcb.QueryCheckList(" and emcode='0035' and dcode='" + fcode + "' and otype='" + otype + "'"); 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(); bf.otype = bso == null ? "" : bso.otype; bf.cdate = DateTime.Now.ToString(); if (bof != null) { if (bofb.Update(bf)) { r = "S"; if (fline != "") { 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"; if (fline != "") { bppb.SetProduceProcess(sid, fline); } BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(sid, bcode, "1", "分单"); //bcpb.OrderCgComputePrice(sid); } else { r = "F"; } } } else { r = iv.badstr; } return(r); }