Example #1
0
        public static string SaveCustomeAccount(string address, string citycode, string cityname, string customer, string dcode, string dname, string gsid, string id, string pcate, string pmoney, string remark, string scode, string telephone)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                A_CustomeAccount sd = new A_CustomeAccount();
                sd.citycode  = citycode;
                sd.cityname  = cityname;
                sd.dcode     = dcode;
                sd.dname     = dname;
                sd.customer  = customer;
                sd.telephone = telephone;
                sd.address   = address;
                sd.pmoney    = Convert.ToDecimal(pmoney);
                sd.ptype     = 1;
                sd.scode     = scode;
                sd.pstate    = 0;
                sd.pcate     = pcate;
                sd.sid       = "";
                sd.gsid      = CommonBll.GetSid();
                sd.ddate     = DateTime.Now.ToString();
                sd.cdate     = DateTime.Now.ToString();
                sd.remark    = remark;
                sd.maker     = iv.u.ename;
                if (id == "" || id == "0")
                {
                    if (acab.Add(sd) > 0)
                    {
                        bwfb.CreateWorkFlow(sd.gsid, "0092");
                        r = sd.gsid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    sd.gsid = gsid;
                    if (acab.Update(sd))
                    {
                        r = sd.gsid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #2
0
        public static string SaveGatherOrder(string gdate, string gmoney, string gmethod, string gperson, string gremark, string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_CustormOrder   bco = bcob.Query(" and csid='" + sid + "'");
                A_CustomeAccount bcg = new A_CustomeAccount();
                bcg.gsid      = CommonBll.GetSid();
                bcg.address   = bco.address;
                bcg.customer  = bco.customer;
                bcg.telephone = bco.telephone;
                bcg.citycode  = bco.e_citycode;
                bcg.cityname  = bco.e_city;
                bcg.dcode     = bco.dcode;
                bcg.dname     = bco.dname;
                bcg.pcate     = "订金";
                bcg.scode     = bco.wcode;
                bcg.ptype     = 1;
                bcg.pstate    = 0;
                bcg.pmethod   = gmethod;
                bcg.pmoney    = Convert.ToDecimal(gmoney);
                bcg.maker     = gperson;
                bcg.remark    = gremark;
                bcg.ddate     = CommonBll.GetBdate(gdate);
                bcg.cdate     = DateTime.Now.ToString();
                bcg.sid       = sid;
                if (acab.Exists(" and sid='" + sid + "'"))
                {
                    if (acab.UpdateEx(bcg))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (acab.Add(bcg) > 0)
                    {
                        bwfb.CreateWorkFlow(bcg.gsid, "0092");
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #3
0
        public static string SaveCustomeMoney(string address, string csid, string customer, string emcode, string id, string omoney, string remark, string settlement, string sid, string telephone, string ycode)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_CustomeMoneyOrder bcmo = new B_CustomeMoneyOrder();
                bcmo.address    = address;
                bcmo.ccode      = "DJ" + DateTime.Now.ToString("yyyyMMddHHmmss");
                bcmo.cdate      = DateTime.Now.ToString();
                bcmo.sid        = sid;
                bcmo.csid       = csid;
                bcmo.customer   = customer;
                bcmo.maker      = iv.u.ename;
                bcmo.omoney     = Convert.ToDecimal(omoney);
                bcmo.telephone  = telephone;
                bcmo.ycode      = ycode;
                bcmo.settlement = settlement;
                bcmo.remark     = remark;
                if (id == "0")
                {
                    bcmo.csid = CommonBll.GetSid();
                    CB_OrderState cos = new CB_OrderState();
                    if (bcmob.Add(bcmo) > 0)
                    {
                        bwfb.CreateWorkFlow(bcmo.csid, emcode);
                        cos.sid = bcmo.csid;
                        cosb.Add(cos);
                        r = bcmo.csid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    bcmo.csid = csid;
                    if (bcmob.Update(bcmo))
                    {
                        r = bcmo.csid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #4
0
        public static string SaveOrder(string cityname, string citycode, string emcode, string osid, string remark, string sid, string shopcode, string shopname)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_DrawProductionOrder ino = new B_DrawProductionOrder();
                ino.bdcode   = iv.u.dcode.Substring(0, 8);
                ino.cdate    = DateTime.Now.ToString();
                ino.cityname = cityname;
                ino.citycode = citycode;
                ino.maker    = iv.u.ename;
                ino.osid     = osid;
                ino.remark   = remark;
                ino.scode    = "NP" + DateTime.Now.ToString("yyyyMMddHHmmss");
                if (sid == "")
                {
                    ino.sid = CommonBll.GetSid();
                    if (bmppob.Add(ino) > 0)
                    {
                        if (ino.osid != "")
                        {
                            cosb.UpState(ino.osid, "ipdraw", 1);
                        }
                        CB_OrderState cos = new CB_OrderState();
                        cos.sid = ino.sid;
                        cosb.Add(cos);
                        bwfb.CreateWorkFlow(ino.sid, emcode);
                        r = ino.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    ino.sid = sid;
                    if (bmppob.Update(ino))
                    {
                        r = ino.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #5
0
        public static string SaveOrder(string bcode, string creason, string emcode, string mtype, string sid, string osid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_SaleChangeOrder bsco = new B_SaleChangeOrder();
                if (sid == "")
                {
                    bsco.sid     = CommonBll.GetSid();
                    bsco.osid    = osid;
                    bsco.creason = creason;
                    bsco.mtype   = mtype;
                    bsco.sqcode  = "BS" + DateTime.Now.ToString("yyMMddHHmmss");
                    bsco.maker   = iv.u.ename;
                    bsco.cdate   = DateTime.Now.ToString();
                    bsco.qtimg   = qcb.CreateQtCode(System.Web.HttpContext.Current.Server.MapPath("/UpFile/OrderQt/"), CommonBll.GetHost() + "UIClient/ChangeServiceBusiness/DistributorChangeDoorMqOrder/CDoorFrameSaleOrder.htm?Sid=" + bsco.sid);
                    if (bscob.Add(bsco) > 0)
                    {
                        CB_OrderState cos = new CB_OrderState();
                        cos.sid = bsco.sid;
                        cosb.Add(cos);
                        bwfb.CreateWorkFlow(bsco.sid, emcode);
                        r = bsco.sid;
                    }
                }
                else
                {
                    bsco.sid     = sid;
                    bsco.osid    = osid;
                    bsco.creason = creason;
                    bsco.maker   = iv.u.ename;
                    bsco.cdate   = DateTime.Now.ToString();
                    if (bscob.Update(bsco))
                    {
                        r = bsco.sid;
                    }
                }
                BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(bsco.sid, bcode, "1", "保存更改单");
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #6
0
        public static string SaveWjOrder(string city, string code, string id, string remark, string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_PreWjOrder bpw = new B_PreWjOrder();
                bpw.sid    = sid;
                bpw.wjcode = code;
                bpw.cdate  = DateTime.Now.ToString();
                bpw.e_city = city;
                bpw.maker  = iv.u.ename;
                bpw.remark = remark;
                if (id == "0")
                {
                    if (bpwb.Add(bpw) > 0)
                    {
                        bwfb.CreateWorkFlow(bpw.sid, "0054");
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (bpwb.Update(bpw))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #7
0
        public static string SavePayOrder(string caccount, string cbank, string cperson, string ctype, string id, string paccount, string pbank, string pdate, string pmethod, string pmoney, string pperson, string remark, string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_CityPayOrder bcp = new B_CityPayOrder();
                bcp.sid      = sid;
                bcp.caccount = caccount;
                bcp.cbank    = cbank;
                bcp.cperson  = cperson;
                bcp.ctype    = ctype;
                bcp.paccount = paccount;
                bcp.pbank    = pbank;
                bcp.pdate    = pdate;
                bcp.pmethod  = pmethod;
                bcp.pmoney   = Convert.ToDecimal(pmoney);
                bcp.pperson  = pperson;
                bcp.pstate   = 1;
                bcp.remark   = remark;
                bcp.cdate    = DateTime.Now.ToString();
                bcp.maker    = iv.u.ename;
                if (bcpob.Exists(" and pstate=0"))
                {
                    bcp.pcode = "MKDP" + DateTime.Now.ToString("yyMMddhhmmss");
                    bwfb.CreateWorkFlow(bcp.sid, "0099");
                    cosb.Add(sid);
                }
                if (bcpob.Update(bcp))
                {
                    r = sid;
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #8
0
        public static string SaveOrder(string address, string bcode, string city, string citycode, string community, string customer, string dcode, string designer, string dname, string emcode, string id, string maker, string mname, string precode, string remark, string saletelephone, string sid, string source, string telephone, string zbdesigner)
        {
            string              r   = "";
            B_MzSaleOrder       bms = new B_MzSaleOrder();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                bms.acode      = "";
                bms.aname      = "";
                bms.address    = address;
                bms.community  = community;
                bms.city       = city;
                bms.citycode   = citycode;
                bms.customer   = customer;
                bms.dname      = dname;
                bms.dcode      = dcode;
                bms.designer   = designer;
                bms.maker      = iv.u.ename;
                bms.mname      = mname;
                bms.ycode      = precode;
                bms.remark     = remark;
                bms.source     = source;
                bms.telephone  = telephone;
                bms.zbdesigner = zbdesigner;
                bms.cdate      = DateTime.Now.ToString();
                if (id == "0")
                {
                    bms.sid = CommonBll.GetSid();
                    CB_OrderState cos = new CB_OrderState();
                    if (bmsob.Add(bms) > 0)
                    {
                        bwfb.CreateWorkFlow(bms.sid, emcode);
                        cos.sid = bms.sid;
                        cosb.Add(cos);
                        if (!bcb.Exists(" and telephone='" + telephone + "'"))
                        {
                            B_Customer bc = new B_Customer();
                            bc.dname     = bms.dname;
                            bc.dcode     = bms.dcode;
                            bc.customer  = bms.customer;
                            bc.telephone = bms.telephone;
                            bc.community = bms.community;
                            bc.address   = bms.address;
                            bc.cdate     = DateTime.Now.ToString();
                            bc.maker     = bms.maker;
                            bcb.Add(bc);
                        }
                        r = bms.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    bms.sid = sid;
                    if (bmsob.Update(bms))
                    {
                        r = bms.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #9
0
        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);
        }
Example #10
0
        public static string SaveOrder(string acity, string address, string aprovince, string azperson, string bcode, string city, string citycode, string clperson, string ctype, string customer, string dcode, string discode, string dname, string emcode, string iscl, string maker, string mname, string otype, string pbdcode, string qytype, string remark, string saletelephone, string sdtype, string sid, string source, string stype, string telephone, string untype, string zcode, string zsid)
        {
            string r     = "";
            string saddr = "";

            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_Orders           bo   = bob.Query(" and sid='" + zsid + "'");
                Sys_CityGetAddress scga = scgab.QueryFrist(" and dcode='" + citycode + "'");
                Sys_Brands         sbs  = sbb.Query(" and pbcode='" + pbdcode + "'");
                B_SaleOrder        bco  = new B_SaleOrder();
                if (scga != null)
                {
                    saddr = scga.address;
                }
                bco.csid        = bo != null ? bo.csid : "";
                bco.zsid        = zsid;
                bco.zcode       = bo != null?bo.zcode:"";
                bco.wcode       = "";
                bco.oscode      = "";
                bco.customer    = customer;
                bco.telephone   = telephone;
                bco.community   = "";
                bco.address     = address.Replace(",", ",");
                bco.dname       = dname;
                bco.dcode       = dcode;
                bco.city        = city;
                bco.citycode    = citycode;
                bco.gzname      = "";
                bco.gztelephone = "";
                bco.stelephone  = saletelephone;
                bco.otype       = otype;
                bco.sendtype    = stype;
                bco.sdtype      = sdtype;
                bco.mname       = mname;
                bco.source      = source;
                bco.remark      = remark.Replace(",", ",");
                bco.maker       = maker;
                bco.cdate       = DateTime.Now.ToString();
                bco.istax       = false;
                bco.isdf        = false;
                bco.iscl        = iscl == "0" ? false : true;
                bco.colorpane   = "";
                bco.floor       = "";
                bco.disactcode  = discode;
                bco.bdcode      = iv.u.dcode.Substring(0, 8);
                bco.clperson    = clperson;
                bco.azperson    = azperson;
                bco.pbdcode     = pbdcode;
                bco.pbdname     = sbs != null ? sbs.pbname : "";
                bco.saddress    = aprovince == "" ? saddr : aprovince + acity + address;
                bco.qytype      = qytype;
                bco.ctype       = ctype;
                bco.untype      = untype;
                if (bco.citycode.Substring(0, 12) != "000100010008")
                {
                    bco.package = "外地包装";
                }
                else
                {
                    bco.package = "本地包装";
                }
                bco.sdcode = "S" + DateTime.Now.ToString("yyMM") + bsob.QueryOrderNum();
                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/QtScan/OrderDetail.htm?Sid=" + bco.sid);
                    if (bsob.Add(bco) > 0)
                    {
                        bwfb.CreateWorkFlow(bco.sid, emcode);
                        cos.sid = bco.sid;
                        cosb.Add(cos);
                        r = bco.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(bco.sid, bcode, "1", " 保存订单");
                }
                else
                {
                    bco.sid = sid;
                    if (bsob.Update(bco))
                    {
                        if (bmob.Exists(" and osid='" + sid + "'"))
                        {
                            if (!bco.iscl)
                            {
                                bmob.Delete(" and osid='" + sid + "'");
                            }
                        }
                        r = bco.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(bco.sid, bcode, "1", " 更改订单");
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #11
0
        public JsonResult SaveFixOrder(string address, string code, string customer, string remark, string sid, string telephone)
        {
            JsonData            d   = new JsonData();
            B_FixOrder          bf  = new B_FixOrder();
            CB_OrderState       cos = new CB_OrderState();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                bf.cdate     = DateTime.Now.ToString();
                bf.scode     = code;
                bf.customer  = customer;
                bf.telephone = telephone;
                bf.address   = address;
                bf.dcode     = "01080101";
                bf.dname     = "北京市";
                bf.remark    = remark;
                bf.maker     = iv.u.ename;
                if (sid == "")
                {
                    if (bfb.Exists(" and scode='" + bf.scode + "'"))
                    {
                        d.d = "T";
                    }
                    else
                    {
                        bf.sid = CommonBll.GetSid();
                        if (bfb.Add(bf) > 0)
                        {
                            cos.sid = bf.sid;
                            cosb.Add(cos);
                            bwfb.CreateWorkFlow(bf.sid, "0077");
                            d.d = bf.sid;
                        }
                        else
                        {
                            d.d = "F";
                        }
                    }
                }
                else
                {
                    bf.sid = sid;
                    if (bfb.Exists(" and scode='" + bf.scode + "' and sid<>'" + sid + "'"))
                    {
                        d.d = "T";
                    }
                    else
                    {
                        if (bfb.Update(bf))
                        {
                            d.d = bf.sid;
                        }
                        else
                        {
                            d.d = "F";
                        }
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Example #12
0
        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);
        }
Example #13
0
        public static string SaveOrder(string acity, string address, string aprovince, string areason, string bcode, string city, string citycode, string customer, string dcode, string dname, string emcode, string maker, string oscode, string osid, string remark, string sid, string telephone)
        {
            string              r  = "";
            B_AfterApplyOrder   b  = new B_AfterApplyOrder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                b.osid      = osid;
                b.address   = address;
                b.acity     = acity;
                b.aprovince = aprovince;
                b.customer  = customer;
                b.dcode     = dcode;
                b.dname     = dname;
                b.city      = city;
                b.citycode  = citycode;
                b.maker     = iv.u.ename;
                b.osid      = osid;
                b.oscode    = oscode;
                b.remark    = remark;
                b.areason   = areason;
                b.telephone = telephone;
                b.cdate     = DateTime.Now.ToString("yyyy-MM-dd");
                if (sid == "")
                {
                    b.scode = "HFS" + DateTime.Now.ToString("yyMM") + bsob.GetOrderNum().ToString().PadLeft(5, '0');
                    b.sid   = CommonBll.GetSid();
                    if (bsob.Add(b) > 0)
                    {
                        r = b.sid;
                        CB_OrderState cs = new CB_OrderState();
                        cs.sid = b.sid;
                        cosb.Add(cs);
                        bwfb.CreateWorkFlow(b.sid, emcode);
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(b.sid, bcode, "1", "创建售后申请单");
                }
                else
                {
                    b.sid = sid;
                    if (bsob.Update(b))
                    {
                        r = b.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(b.sid, bcode, "1", "更新售后申请单");
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #14
0
        public static string SaveOrder(string bcode, string city, string citycode, string dcode, string dname, string emcode, string maker, string otype, string remark, string saddress, string sid, string sperson, string stelephone, string wltype)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_SaleMaterielOrder bco = new B_SaleMaterielOrder();
                bco.acode      = "";
                bco.aname      = "";
                bco.bdcode     = "";
                bco.cdate      = DateTime.Now.ToString();
                bco.city       = city;
                bco.citycode   = citycode;
                bco.dcode      = dcode;
                bco.dname      = dname;
                bco.gdiscount  = 1;
                bco.maker      = maker;
                bco.otype      = otype;
                bco.remark     = remark;
                bco.saddress   = saddress;
                bco.stelephone = stelephone;
                bco.qtimg      = "";
                bco.sperson    = sperson;
                bco.wltype     = wltype;
                bco.bdcode     = "00010001";
                if (sid == "")
                {
                    bco.sid = CommonBll.GetSid();
                    if (bsmob.Add(bco) > 0)
                    {
                        CB_OrderState cos = new CB_OrderState();
                        cos.sid = bco.sid;
                        cosb.Add(cos);
                        bwfb.CreateWorkFlow(bco.sid, emcode);
                        r = bco.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    bco.sid = sid;
                    if (bsmob.Update(bco))
                    {
                        r = bco.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
                EventBtnDo.FireEventBtn(bco.sid, bcode, "1", "订单保存");
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #15
0
        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);
        }
Example #16
0
        public static string SaveOrder(string acity, string address, string aprovince, string areason, string asid, string bcode, string customer, string dcode, string emcode, string gofee, string maker, string oscode, string osid, string remark, string sdate, string servfee, string sid, string sscode, string stext, string telephone)
        {
            string r = "";
            B_AfterFreeBackOrder b  = new B_AfterFreeBackOrder();
            SessionUserValidate  iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                Sys_Depment cs = sdb.Query(" and dcode='" + dcode.Substring(0, dcode.Length - 4) + "'");
                b.osid      = osid;
                b.asid      = asid;
                b.address   = address;
                b.acity     = acity;
                b.aprovince = aprovince;
                b.customer  = customer;
                b.telephone = telephone;
                b.dcode     = dcode;
                b.dname     = sd.dname;
                b.city      = cs.dname;
                b.citycode  = cs.dcode;
                b.maker     = iv.u.ename;
                b.oscode    = oscode;
                b.sscode    = sscode;
                b.gofee     = Convert.ToDecimal(gofee);
                b.servfee   = Convert.ToDecimal(servfee);
                b.sdate     = CommonBll.GetBdate(sdate);
                b.stext     = stext;
                b.remark    = remark;
                b.scode     = "HAS" + DateTime.Now.ToString("yyMM") + bsob.GetOrderNum().ToString().PadLeft(5, '0');
                b.areason   = areason;
                b.telephone = telephone;
                b.cdate     = DateTime.Now.ToString("yyyy-MM-dd");
                if (sid == "")
                {
                    b.sid = CommonBll.GetSid();
                    if (bsob.Add(b) > 0)
                    {
                        r = b.sid;
                        CB_OrderState cos = new CB_OrderState();
                        cos.sid = b.sid;
                        cosb.Add(cos);
                        bwfb.CreateWorkFlow(b.sid, emcode);
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(b.sid, bcode, "1", "创建售后单");
                }
                else
                {
                    b.sid = sid;
                    if (bsob.Update(b))
                    {
                        r = b.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(b.sid, bcode, "1", "更新售后单");
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #17
0
        public static string SaveOrder(string acity, string address, string aprovince, string areason, string ascode, string asid, string bcode, string city, string citycode, string customer, string dcode, string dname, string emcode, string isfc, string maker, string oscode, string osid, string otype, string ptype, string remark, string sid, string stype, string telephone)
        {
            string r = "";
            SessionUserValidate  iv = SysValidateBll.ValidateSession();
            B_AfterReModifyOrder ao = new B_AfterReModifyOrder();

            if (iv.f)
            {
                ao.acity     = acity;
                ao.aprovince = aprovince;
                if (acity == "")
                {
                    Sys_CityGetAddress sca = scgab.QueryRefFrist(dcode);
                    ao.address = sca != null ? sca.address : "";
                }
                else
                {
                    ao.address = address;
                }
                Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                ao.ascode    = ascode.Trim();
                ao.asid      = asid;
                ao.cdate     = DateTime.Now.ToString();
                ao.city      = city;
                ao.citycode  = citycode;
                ao.customer  = customer;
                ao.dcode     = dcode;
                ao.dname     = dname;
                ao.isbf      = isfc == "1" ? true : false;
                ao.maker     = maker;
                ao.oscode    = oscode;
                ao.osid      = osid;
                ao.otype     = otype;
                ao.ptype     = ptype;
                ao.remark    = remark;
                ao.sendtype  = stype;
                ao.telephone = telephone;
                ao.areason   = areason;
                ao.qytype    = sd != null ? sd.dmattr : "";
                if (sid == "")
                {
                    string cnstr = basob.GetOrderNum().ToString().PadLeft(4, '0');
                    if (cnstr.Length > 4)
                    {
                        cnstr = cnstr.Substring(1, cnstr.Length - 1);
                    }
                    ao.scode = "HF" + DateTime.Now.ToString("yyMM") + cnstr;
                    ao.sid   = CommonBll.GetSid();
                    if (basob.Add(ao) > 0)
                    {
                        r = ao.sid;
                        CB_OrderState cs = new CB_OrderState();
                        cs.sid = ao.sid;
                        cosb.Add(cs);
                        bwfb.CreateWorkFlow(ao.sid, emcode);
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(ao.sid, bcode, "1", "创建返修单");
                }
                else
                {
                    ao.sid = sid;
                    if (basob.Update(ao))
                    {
                        r = ao.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(ao.sid, bcode, "1", "更新返修单");
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #18
0
        public static string SaveOrder(string acity, string address, string aprovince, string bcode, string csid, string customer, string emcode, string gzname, string mdate, string mremark, ArrayList plist, string sid, string telephone)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_SaleOrder    bso = bsob.Query(" and sid='" + sid + "'");
                B_MeasureOrder bco = new B_MeasureOrder();
                bco.acity     = acity;
                bco.address   = address;
                bco.aprovince = aprovince;
                bco.customer  = customer;
                bco.gzname    = gzname;
                bco.maker     = iv.u.ename;
                bco.mdate     = mdate;
                bco.mremark   = mremark;
                bco.osid      = sid;
                bco.telephone = telephone;
                bco.city      = bso.city;
                bco.citycode  = bso.citycode;
                bco.dcode     = bso.dcode;
                bco.dname     = bso.dname;
                bco.mname     = bso.mname;
                bco.cdate     = DateTime.Now.ToString();
                bco.sdcode    = DateTime.Now.ToString("yyyymmddhhMMss");
                if (csid == "")
                {
                    bco.sid = CommonBll.GetSid();
                }
                else
                {
                    bco.sid = csid;
                }
                List <B_MeasureProduction> lbp = new List <B_MeasureProduction>();
                foreach (object[] o in plist)
                {
                    B_MeasureProduction bmp = new B_MeasureProduction();
                    var p = o;
                    bmp.cdate  = DateTime.Now.ToString();
                    bmp.maker  = iv.u.ename;
                    bmp.pcname = p[0].ToString();
                    bmp.pcnum  = Convert.ToInt32(p[1].ToString());
                    bmp.sid    = bco.sid;
                    lbp.Add(bmp);
                }
                bco.bplist = lbp;
                if (bmlb.CheckLimited(bco.dcode, bco.mdate))
                {
                    r = "MOB";
                }
                else
                {
                    if (csid == "")
                    {
                        CB_OrderState cos = new CB_OrderState();
                        bco.qtimg = qcb.CreateQtCode(System.Web.HttpContext.Current.Server.MapPath("/UpFile/OrderQt/"), CommonBll.GetHost() + "UIClient/SalesBusiness/DistributorOrder/SaleOrderDetail.htm?Sid=" + bco.sid);
                        if (bmob.Add(bco) > 0)
                        {
                            bwfb.CreateWorkFlow(bco.sid, emcode);
                            cos.sid = bco.sid;
                            cosb.Add(cos);
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                        EventBtnDo.FireEventBtn(bco.sid, bcode, "1", " 保存测量单");
                    }
                    else
                    {
                        if (bmob.Update(bco))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                        EventBtnDo.FireEventBtn(bco.sid, bcode, "1", " 更改测量单");
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #19
0
        public static string SaveOrder(string address, string amethod, string areason, string atype, string bcode, string city, string citycode, string community, string customer, string dcode, string dname, string emcode, string maker, string mname, string mtype, string oscode, string osid, string otype, string remark, string sid, string telephone)
        {
            string              r  = "";
            B_YqAfterSaleOrder  b  = new B_YqAfterSaleOrder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                b.osid      = osid;
                b.address   = address;
                b.aname     = "";
                b.acode     = "";
                b.community = "";
                b.customer  = customer;
                b.dcode     = dcode;
                b.dname     = dname;
                b.city      = city;
                b.citytype  = "";
                b.citycode  = citycode;
                b.maker     = iv.u.ename;
                b.mname     = mname;
                b.osid      = osid;
                b.otype     = otype;
                b.oscode    = oscode;
                b.remark    = remark;
                b.scode     = "";
                b.method    = amethod;
                b.areason   = areason;
                b.source    = "";
                b.telephone = telephone;
                b.cdate     = DateTime.Now.ToString("yyyy-MM-dd");
                if (sid == "")
                {
                    b.sid = CommonBll.GetSid();
                    if (basob.Add(b) > 0)
                    {
                        r = b.sid;
                        CB_OrderState cs = new CB_OrderState();
                        cs.sid = b.sid;
                        cosb.Add(cs);
                        bwfb.CreateWorkFlow(b.sid, emcode);
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    b.sid = sid;
                    if (basob.Update(b))
                    {
                        r = b.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #20
0
        public static string SaveMzOrder(string address, string area, string city, string citycode, string colorpane, string customer,
                                         string dcode, string designer, string dname, string dtype, string id, string lxtype, string maker, string mname, string otype, string precode, string remark, string sid, string source, string telephone)
        {
            string              r   = "";
            B_QbqqSaleOrder     bms = new B_QbqqSaleOrder();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                bms.acode     = "";
                bms.aname     = "";
                bms.address   = address;
                bms.community = area;
                bms.city      = city;
                bms.citycode  = citycode;
                bms.colorpane = colorpane;
                bms.customer  = customer;
                bms.dname     = dname;
                bms.dcode     = dcode;
                bms.designer  = designer;
                bms.maker     = iv.u.ename;
                bms.mname     = mname;
                bms.otype     = otype;
                bms.ycode     = precode;
                bms.remark    = remark;
                bms.source    = source;
                bms.telephone = telephone;
                bms.packtype  = lxtype;
                bms.dtype     = dtype;
                bms.cdate     = DateTime.Now.ToString();
                if (id == "0")
                {
                    bms.sid = CommonBll.GetSid();
                    CB_OrderState cos = new CB_OrderState();
                    if (bmsob.Add(bms) > 0)
                    {
                        Sys_MzOrderType smot = smotb.Query(" and mtname='" + dtype + "'");
                        if (smot != null)
                        {
                            bwfb.CreateWorkFlow(bms.sid, smot.emcode);
                        }
                        cos.sid = bms.sid;
                        cosb.Add(cos);
                        if (!bcb.Exists(" and telephone='" + telephone + "'"))
                        {
                            B_Customer bc = new B_Customer();
                            bc.dname     = bms.dname;
                            bc.dcode     = bms.dcode;
                            bc.customer  = bms.customer;
                            bc.telephone = bms.telephone;
                            bc.community = bms.community;
                            bc.address   = bms.address;
                            bc.cdate     = DateTime.Now.ToString();
                            bc.maker     = bms.maker;
                            bcb.Add(bc);
                        }
                        r = bms.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    bms.sid = sid;
                    if (bmsob.Update(bms))
                    {
                        Sys_MzOrderType smot = smotb.Query(" and mtname='" + dtype + "'");
                        if (smot != null)
                        {
                            bwfb.CreateWorkFlow(bms.sid, smot.emcode);
                        }
                        r = bms.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #21
0
        public static string SaveOrder(string account, string bcode, string city, string citycode, string emcode, string maker, string paccount, string pdate, string pmethod, string pmoney, string remark, string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sbk_PaymentAccount    pa  = spab.Query(" and pcode=" + paccount + "");
                Sbk_CollectionAccount ca  = scab.Query(" and id=" + account + "");
                B_CityPayOrder        bco = new B_CityPayOrder();
                bco.caccount = ca.aname;
                bco.cbank    = ca.abank;
                bco.cperson  = ca.aperson;
                bco.cbcode   = ca.bcode;
                bco.ctype    = "";
                bco.dcode    = citycode;
                bco.dname    = city;
                bco.maker    = maker;
                bco.paccount = pa.pname;
                bco.pbank    = pa.pbank;
                bco.pbcode   = pa.pbcode;
                bco.sacode   = pa.sacode;
                bco.pcode    = "P" + DateTime.Now.ToString("yyyyMMddHHmmss");
                bco.pdate    = pdate;
                bco.pmethod  = pmethod;
                bco.pmoney   = Convert.ToDecimal(pmoney);
                bco.pperson  = pa.pperson;
                bco.pstate   = 0;
                bco.remark   = remark.Replace(",", ",");
                bco.maker    = maker;
                bco.cdate    = DateTime.Now.ToString();
                if (sid == "")
                {
                    CB_OrderState cos = new CB_OrderState();
                    bco.sid  = CommonBll.GetSid();
                    bco.pimg = qcb.CreateQtCode(System.Web.HttpContext.Current.Server.MapPath("/UpFile/OrderQt/"), CommonBll.GetHost() + "UIClient/SalesBusiness/DistributorOrder/SaleOrderDetail.htm?Sid=" + bco.sid);
                    if (bcpob.Add(bco) > 0)
                    {
                        bwfb.CreateWorkFlow(bco.sid, emcode);
                        cos.sid = bco.sid;
                        cosb.Add(cos);
                        r = bco.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(bco.sid, bcode, "1", " 保存订单");
                }
                else
                {
                    bco.sid = sid;
                    if (bcpob.Update(bco))
                    {
                        r = bco.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(bco.sid, bcode, "1", " 更改订单");
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }