Example #1
0
        public JsonResult InitAddr(string dcode, string sacode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_CityGetAddress sal = new Sys_CityGetAddress();
                if (sacode != "")
                {
                    sal = scgab.Query(" and  sacode='" + sacode + "'");
                }
                else
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + dcode + "'");
                    sal.id     = 0;
                    sal.sacode = scgab.CreateCode().ToString().PadLeft(4, '0');
                    sal.dcode  = sd == null ? "" : sd.dcode;
                    sal.dname  = sd == null ? "" : sd.dname;
                }
                d.d = js.Serialize(sal);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Example #2
0
        public JsonResult SaveAddr(string address, string aid, string dcode, string dname, string fsel, string gperson, string sacode, string telephone)
        {
            JsonData            d  = new JsonData();
            Sys_CityGetAddress  sa = new Sys_CityGetAddress();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sa.address   = address;
                sa.dcode     = dcode;
                sa.dname     = dname;
                sa.cdate     = DateTime.Now.ToString();
                sa.gperson   = gperson;
                sa.isfrist   = fsel == "1"?true:false;
                sa.sacode    = sacode;
                sa.maker     = iv.u.ename;
                sa.telephone = telephone;
                if (aid == "0")
                {
                    if (scgab.Add(sa) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    sa.id = Convert.ToInt32(aid);
                    if (scgab.Update(sa))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Example #3
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 #4
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 #5
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);
        }