Beispiel #1
0
        public static string initCustomer()
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_Customer  bc = new B_Customer();
                Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                if (sd != null)
                {
                    Sys_Depment ct = sdb.Query(" and dcode='" + sd.dpcode + "'");
                    if (ct != null)
                    {
                        bc.aprovince = ct.dpname;
                        bc.acity     = ct.dcity;
                    }
                }
                r = js.Serialize(bc);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #2
0
        public static string SaveOrder(string sid, string ncity, string nprovince, string nad)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string      dc = iv.u.dcode;
                Sys_Depment sd = sdb.Query(" and dcode='" + dc + "'");
                B_Customer  bc = bcb.Query(" and sid='" + sid + "'");
                if (bc != null)
                {
                    B_Orders bs = new B_Orders();
                    bs.address   = nad.Trim() == "" ? bs.address : nad;
                    bs.community = "";
                    bs.cdate     = DateTime.Now.ToString();
                    bs.city      = bc.city;
                    bs.citycode  = bc.citycode;
                    bs.csid      = bc.sid;
                    bs.customer  = bc.customer;
                    bs.dcode     = bc.dcode;
                    bs.dname     = bc.dname;
                    bs.telephone = bc.telephone;
                    bs.sid       = CommonBll.GetSid();
                    bs.acity     = ncity;
                    bs.aprovince = nprovince;
                    bs.zcode     = "Z" + DateTime.Now.ToString("yyyyMMddHHmmss");
                    if (bob.Add(bs) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #3
0
        public static string InitQuery(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_Orders   bo = new B_Orders();
                B_Customer bc = bcb.Query(" and sid='" + sid + "'");
                if (bc != null)
                {
                    bo.acity     = bc.acity;
                    bo.aprovince = bc.aprovince;
                    bo.address   = bc.address;
                }
                r = js.Serialize(bo);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #4
0
        public static string SaveCustomer(string acity, string address, string aprovince, string ctype, string customer, string telephone)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (bcb.Exists(" and telephone='" + telephone + "' and address='" + address.Trim() + "'"))
                {
                    r = "T";
                }
                else
                {
                    string      dc = iv.u.dcode;
                    Sys_Depment sd = sdb.Query(" and dcode='" + dc + "'");
                    B_Customer  bc = new B_Customer();
                    bc.sid       = CommonBll.GetSid();
                    bc.address   = address;
                    bc.community = "";
                    bc.ctype     = ctype;
                    bc.customer  = customer;
                    bc.telephone = telephone.Trim();
                    bc.acity     = acity;
                    bc.aprovince = aprovince;
                    if (sd.dattr == "dm")
                    {
                        bc.dcode    = sd.dcode;
                        bc.dname    = sd.dname;
                        bc.city     = sd.dpname;
                        bc.citycode = sd.dpcode;
                        bc.bdcode   = sd.dcode.Substring(0, 8);
                    }
                    else
                    {
                        Sys_Depment sdc = sdb.Query(" and dpcode='" + sd.dcode + "'");
                        if (sdc != null)
                        {
                            bc.dcode = sdc.dcode;
                            bc.dname = sdc.dname;
                        }
                        bc.city     = sd.dname;
                        bc.citycode = sd.dcode;
                        bc.bdcode   = sd.dcode.Substring(0, 8);
                    }
                    bc.maker = iv.u.ename;
                    bc.cdate = DateTime.Now.ToString();
                    if (bcb.Add(bc) > 0)
                    {
                        B_Orders bs = new B_Orders();
                        bs.address   = address;
                        bs.cdate     = DateTime.Now.ToString();
                        bs.city      = bc.city;
                        bs.citycode  = bc.citycode;
                        bs.community = bc.community;
                        bs.csid      = bc.sid;
                        bs.customer  = customer;
                        bs.dcode     = bc.dcode;
                        bs.dname     = bc.dname;
                        bs.telephone = bc.telephone;
                        bs.sid       = CommonBll.GetSid();
                        bs.zcode     = "Z" + DateTime.Now.ToString("yyyyMMddHHmmss");
                        bob.Add(bs);
                        r = bs.csid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #5
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);
        }
Beispiel #6
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);
        }
Beispiel #7
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);
        }
Beispiel #8
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);
        }