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

            if (iv.f)
            {
                B_PreWjOrder bpw = new B_PreWjOrder();
                if (sid == "")
                {
                    bpw.wjcode = "BW" + DateTime.Now.ToString("yyyyMMddHHmmss");
                    bpw.id     = 0;
                    bpw.sid    = CommonBll.GetSid();
                }
                else
                {
                    bpw = bpwb.Query(" and sid='" + sid + "'");
                }
                r = js.Serialize(bpw);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #2
0
        public static string InitPayOrder(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_CityPayOrder bcp = new B_CityPayOrder();
                if (sid != "")
                {
                    bcp = bcpob.Query(" and sid='" + sid + "'");
                }
                else
                {
                    bcp.sid    = CommonBll.GetSid();
                    bcp.dname  = iv.u.dname;
                    bcp.dcode  = iv.u.dcode;
                    bcp.pstate = 0;
                    bcp.cdate  = DateTime.Now.ToString();
                    bcp.maker  = iv.u.ename;
                    bcp.id     = 0;
                    bcpob.AddDraft(bcp);
                }
                r = js.Serialize(bcp);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #3
0
        public static string ProductionOutHouse(string sid, string psid, string remark)
        {
            string r    = "";
            string code = "";

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_AfterSaleOrder ba  = basb.Query(" and sid='" + sid + "'");
                B_SaleOrder      bso = bsob.Query(" and sid='" + sid + "'");
                if (bso != null)
                {
                    code = bso.scode;
                }
                if (ba != null)
                {
                    code = ba.scode;
                }
                List <B_HouseProdcution> lbhp = bhpb.QueryList(" and sid='" + sid + "'");
                string[] arr  = psid.Split(';');
                string   osid = CommonBll.GetSid();
                if (bhpb.OutUpdate(arr, osid))
                {
                    bosb.UpState(sid, "istoredeliver", 1);
                    B_ApartSendOrder bo = new B_ApartSendOrder();
                    if (lbhp.Count == arr.Length)
                    {
                        bo.fhcode = code;
                        bo.snum   = 0;
                    }
                    else
                    {
                        bo.snum   = basob.QueryMaxNum(sid);
                        bo.fhcode = code + "-" + bo.snum.ToString();
                    }
                    bo.sid   = sid;
                    bo.osid  = osid;
                    bo.maker = iv.u.ename;
                    bo.cdate = DateTime.Now.ToString();
                    basob.Add(bo);
                    if (!bhpb.Exist(" and ostate=0 and sid='" + sid + "'"))
                    {
                        bosb.UpState(sid, "istoredeliver", 2);
                    }
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }
Beispiel #6
0
        public static string SaveWjProduction(string sid, ArrayList prow)
        {
            string r = "";
            List <B_GroupProduction> lbp  = new List <B_GroupProduction>();
            List <B_ProductionItem>  lbpi = new List <B_ProductionItem>();
            SessionUserValidate      iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                foreach (object[] o in prow)
                {
                    if (Convert.ToInt32(o[1].ToString()) > 0)
                    {
                        B_GroupProduction   bgp = new B_GroupProduction();
                        Sys_InventoryDetail d   = sidb.Query(" and icode='" + o[0].ToString() + "'");
                        bgp.sid   = sid;
                        bgp.psid  = CommonBll.GetSid();
                        bgp.gnum  = 1;
                        bgp.icode = d.icode;
                        bgp.iname = d.iname;
                        bgp.inum  = Convert.ToInt32(o[1].ToString());
                        bgp.ps    = o[2].ToString();
                        lbp.Add(bgp);
                        B_ProductionItem bpi = new B_ProductionItem();
                        bpi.sid     = bgp.sid;
                        bpi.psid    = bgp.psid;
                        bpi.pname   = bgp.iname;
                        bpi.pcode   = bgp.icode;
                        bpi.mname   = "";
                        bpi.ptype   = bgp.itype;
                        bpi.height  = 0;
                        bpi.width   = 0;
                        bpi.deep    = 0;
                        bpi.pnum    = bgp.inum;
                        bpi.e_ptype = "";
                        bpi.maker   = bgp.maker;
                        bpi.cdate   = DateTime.Now.ToString();
                        lbpi.Add(bpi);
                    }
                }
                if (bgpb.SaveList(lbp, sid, 1) > 0)
                {
                    bpitb.SaveItemList(lbpi);
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #7
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);
        }
Beispiel #8
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);
        }
Beispiel #9
0
        public JsonResult SaveFixProduction(string sid, List <String[]> prow)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                List <B_FixProduction> lb = new List <B_FixProduction>();
                if (prow != null)
                {
                    foreach (String[] s in prow)
                    {
                        B_FixProduction b = new B_FixProduction();
                        if (Convert.ToDecimal(s[2]) > 0)
                        {
                            Sys_FixProduction bf = sfpb.Query(" and apcode='" + s[1].ToString() + "'");
                            if (bf != null)
                            {
                                b.sid    = sid;
                                b.psid   = CommonBll.GetSid();
                                b.pname  = bf.apname;
                                b.pcode  = bf.apcode;
                                b.pmoney = bf.apprice;
                                b.pnum   = Convert.ToDecimal(s[2]);
                                b.maker  = iv.u.ename;
                                b.cdate  = DateTime.Now.ToString();
                                lb.Add(b);
                            }
                        }
                    }
                }
                if (lb.Count > 0)
                {
                    if (bfpb.SaveFixProductionList(sid, lb))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    d.d = "F";
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Beispiel #10
0
        public static string ProductionInHouse(string bcode, string sid, string psids, string remark)
        {
            string r = "";
            SessionUserValidate     iv  = SysValidateBll.ValidateSession();
            B_AfterPartInHouseOrder bio = new B_AfterPartInHouseOrder();

            if (iv.f)
            {
                string eco = "";
                int    pc  = bapihob.CreateNum(sid, psids);
                if (pc != 0)
                {
                    eco = "-" + pc.ToString().PadLeft(2, '0');
                }
                B_AfterReModifyOrder bro = barmob.Query(" and sid='" + sid + "'");
                bio.sid    = CommonBll.GetSid();
                bio.osid   = sid;
                bio.pscode = bro.scode + eco;
                bio.scode  = bro.scode;
                bio.remark = remark;
                bio.maker  = iv.u.ename;
                bio.cdate  = DateTime.Now.ToString();
                bio.plist  = psids;
                if (bapihob.Add(bio) > 0)
                {
                    if (!bagpb.Exists(" and sid='" + sid + "' and psid not in (select psid from dbo.B_AfterPartInHouseProduction where osid='" + sid + "')"))
                    {
                        cosb.UpState(sid, "istoreget", 2);
                        cosb.UpState(sid, "iproduce", 2);
                        EventBtnDo.FireEventBtn(sid, bcode, "1", "产品全部入库");
                    }
                    else
                    {
                        EventBtnDo.FireEventBtn(sid, bcode, "1", "产品部分入库");
                    }
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string r = "";
            SessionUserValidate   iv    = SysValidateBll.ValidateSession();
            B_SelectProduceImgBll bspib = new B_SelectProduceImgBll();

            if (iv.f)
            {
                HttpFileCollection files   = Request.Files;
                string             sid     = Request.QueryString["sid"];
                string             spname  = Request.QueryString["spname"];
                string             newname = DateTime.Now.ToString("yyyyMMddhhmmssfff");
                UpFile             uf      = new UpFile();
                ArrayList          efile   = new ArrayList();
                B_SelectProduceImg spi     = new B_SelectProduceImg();

                string url = "/UpFile/ImageMeasure/";
                string ur  = uf.UpImage(files[0], newname, url, 10240000);
                if (ur.Length > 1)
                {
                    spi.sid    = sid;
                    spi.xsid   = CommonBll.GetSid();
                    spi.maker  = iv.u.ename;
                    spi.xpname = spname;
                    spi.xpurl  = url + ur;
                    spi.cdate  = DateTime.Now.ToString();
                    if (bspib.Add(spi) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    r = ur;
                }
            }
            else
            {
                r = iv.badstr;
            }
            Response.Write("{  msg:'" + r + "'}");
            Response.End();
        }
Beispiel #12
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 #13
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);
        }
Beispiel #14
0
        public static string SaveNews(string ndate, string nfbr, string nid, string nshow, string nreader, string ntext, string ntype, string sdep, string tname)
        {
            string              r    = "";
            NB_NewsBll          sicb = new NB_NewsBll();
            NB_News             sic  = new NB_News();
            ArrayList           sbn  = new ArrayList();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (nreader == "seldep")
                {
                    string[] darr = sdep.Split(';');
                    foreach (string dstr in darr)
                    {
                        List <Sys_Depment> lsd = sdb.QueryList(" and dcode like '" + dstr + "%' and disend='true'");
                        if (lsd != null)
                        {
                            foreach (Sys_Depment sd in lsd)
                            {
                                sbn.Add(sd.dcode);
                            }
                        }
                    }
                }
                else
                {
                    nreader = "all";
                    sbn     = null;
                }
                sic.ntitle   = tname;
                sic.ncontent = ntext;
                sic.nreadnum = 0;
                sic.nstate   = nshow == "a"?true:false;
                sic.maker    = iv.u.ename;
                sic.cdate    = DateTime.Now.ToString();
                sic.nvrange  = nreader;
                sic.ntype    = ntype;
                sic.nsid     = CommonBll.GetSid();
                sic.dcode    = "";
                sic.rtype    = "a";
                sic.sdcode   = sdep;
                if (nid == "0")
                {
                    if (sicb.Add(sic) > 0)
                    {
                        r = "S";
                        NB_News sicc = sicb.Query(" and nsid='" + sic.nsid + "'");
                        if (sicc != null)
                        {
                            nid = sicc.id.ToString();
                            ndnb.Add(nid, sbn);
                        }
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    sic.id = Convert.ToInt32(nid);
                    if (sicb.Update(sic))
                    {
                        r = "S";
                        ndnb.Delete(" and nid=" + nid + "");
                        ndnb.Add(nid, sbn);
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #15
0
        public static string SaveQualityProduction(string sid, string qtype, string qremark, string rowid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string             scode   = "";
                string             precode = "";
                B_PartQualityOrder bpqo    = new B_PartQualityOrder();
                B_SaleOrder        bso     = bsob.Query(" and sid='" + sid + "'");
                if (qtype == "s")
                {
                    bpqo.qstate = 1;
                }
                if (qtype == "f")
                {
                    bpqo.qstate = -1;
                    precode     = "F";
                }
                if (bso != null)
                {
                    scode = bso.scode;
                }
                bpqo.cdate  = DateTime.Now.ToString();
                bpqo.maker  = iv.u.ename;
                bpqo.qcode  = scode + "-" + precode + bpqob.QueryQorderNum(" and sid='" + sid + "' and qstate=" + bpqo.qstate + "").ToString();
                bpqo.qsid   = CommonBll.GetSid();
                bpqo.remark = qremark;
                bpqo.sid    = sid;

                List <B_PartQualityItems> lq = new List <B_PartQualityItems>();
                string[] arrow = rowid.ToString().Split(';');
                if (arrow.Length > 0)
                {
                    foreach (string id in arrow)
                    {
                        string             idv   = "";
                        string             etype = "";
                        B_PartQualityItems bpi   = new B_PartQualityItems();
                        if (id.IndexOf('-') > -1)
                        {
                            string [] ids = id.Split('-');
                            idv   = ids[0];
                            etype = ids[1];
                        }
                        else
                        {
                            idv = id;
                        }
                        B_GroupProduction bgp = bgpb.Query(" and id=" + idv + "");
                        if (bgp != null)
                        {
                            bpi.cdate = DateTime.Now.ToString();
                            //if (bgp.ptype == "ms")
                            //{
                            //    B_ProductionItem li = bpib.Query(" and psid='" + bgp.psid + "' and e_ptype='" + etype + "'");
                            //    bpi.deep = li.deep;
                            //    bpi.gnum = bgp.gnum;
                            //    bpi.height = li.height;
                            //    bpi.maker = iv.u.ename;
                            //    bpi.pcode = li.pcode;
                            //    bpi.pname = li.pname;
                            //    bpi.pnum = (int)li.pnum;
                            //    bpi.psid = li.psid;
                            //    bpi.qsid = bpqo.qsid;
                            //    bpi.sid = sid;
                            //    bpi.width = li.width;
                            //    lq.Add(bpi);
                            //}
                            //else
                            //{
                            bpi.deep   = bgp.deep;
                            bpi.gnum   = bgp.gnum;
                            bpi.height = bgp.height;
                            bpi.maker  = iv.u.ename;
                            bpi.pcode  = bgp.icode;
                            bpi.pname  = bgp.iname;
                            bpi.pnum   = (int)bgp.inum;
                            bpi.psid   = bgp.psid;
                            bpi.qsid   = bpqo.qsid;
                            bpi.sid    = sid;
                            bpi.width  = bgp.width;
                            lq.Add(bpi);
                            //}
                        }
                    }
                }
                if (bpqob.SaveQualityOrder(bpqo, lq))
                {
                    List <B_GroupProduction> lbpi = bgpb.QueryList(" and sid='" + sid + "' and substring(icode,9,3)<>'004' and psid not in (select psid from  B_PartQualityItems where qsid in(select qsid from B_PartQualityOrder where sid='" + sid + "' and qstate=1) ) order by gnum");
                    if (lbpi == null)
                    {
                        cosb.UpState(sid, "iquality", 2);
                        cosb.UpState(sid, "ifactorydeliver", 2);
                    }
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #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);
        }
Beispiel #17
0
        public static string ProductionInHouse(string sid, string psid, string remark)
        {
            string r  = "";
            int    zt = 0;

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string           scode = "";
                B_AfterSaleOrder ba    = basb.Query(" and sid='" + sid + "'");
                B_SaleOrder      bo    = bsob.Query(" and sid='" + sid + "'");
                if (bo != null)
                {
                    scode = bo.scode;
                }
                if (ba != null)
                {
                    scode = ba.scode;
                }
                B_InHouseOrder bio = new B_InHouseOrder();
                bio.isid  = CommonBll.GetSid();
                bio.sid   = sid;
                bio.maker = iv.u.ename;
                bio.ps    = remark;
                bio.state = 0;
                bio.cdate = DateTime.Now.ToString();
                string[] arr = psid.Split(';');
                if (bhpb.InUpdate(arr, bio.isid))
                {
                    bosb.UpState(sid, "istoreget", 1);
                    if (!bhpb.Exist(" and istate=0 and sid='" + sid + "'"))
                    {
                        zt = 1;
                        bosb.UpState(sid, "istoreget", 2);
                    }
                    if (!bihob.Exists(" and sid='" + sid + "'") && zt == 1)
                    {
                        bio.icode = scode;
                    }
                    else
                    {
                        List <B_InHouseOrder> bihl = bihob.QueryList(" and sid='" + sid + "'");
                        int n = bihl == null ? 1 : bihl.Count;
                        bio.icode = scode + "-" + n.ToString().PadLeft(2, '0');
                    }
                    bihob.Add(bio);
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string r = "", sid = "", fname = "", dtype = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();
            B_DesignPlanBll     bmib = new B_DesignPlanBll();
            CB_OrderFlowBll     cofb = new CB_OrderFlowBll();

            if (iv.f)
            {
                HttpFileCollection files = Request.Files;
                if (Request.QueryString["sid"] != null)
                {
                    sid = Request.QueryString["sid"];
                }
                if (Request.QueryString["fname"] != null)
                {
                    fname = Request.QueryString["fname"];
                }
                if (Request.QueryString["dtype"] != null)
                {
                    dtype = Request.QueryString["dtype"];
                }
                string       newname = DateTime.Now.ToString("yyyyMMddhhmmssfff");
                UpFile       uf      = new UpFile();
                ArrayList    efile   = new ArrayList();
                B_DesignPlan spi     = new B_DesignPlan();
                string       url     = "/UpFile/DesignFile/";
                string       ur      = uf.UpFiles(files[0], newname, url, 102400000);
                if (ur.Length > 1)
                {
                    string xname = uf.GetFileExName(files[0]);
                    spi.osid   = sid;
                    spi.sid    = CommonBll.GetSid();
                    spi.maker  = iv.u.ename;
                    spi.dname  = fname + xname;
                    spi.durl   = url + ur;
                    spi.emcode = "";
                    spi.dtype  = dtype;
                    spi.rcode  = iv.u.rcode;
                    spi.wcode  = cofb.QueryCurWorkFlow(sid);
                    if (bmib.Add(spi) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    r = ur;
                }
            }
            else
            {
                r = iv.badstr;
            }
            Response.Write("{  msg:'" + r + "'}");
            Response.End();
        }
Beispiel #19
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);
        }
Beispiel #20
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);
        }
Beispiel #21
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 #22
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));
        }
Beispiel #23
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);
        }
Beispiel #24
0
        public static string SaveProduction(string alist, string blcode, string blname, string cavetype, string ctcode, string ctcz, string ctlxcz, string ctname, string cttbcz,
                                            string direction, string fix, string floor, string gnum, string hjcode, string hjcz, string hjname,
                                            string invcate, string isjc, string locks, string locktype, string mscode, string mscz, string msname, string msts, string mtbcode, string mtbcz, string mtbname, string mtcode, string mtcz, string mtlxcz,
                                            string mtname, string mttbcz, string mtts, string optype, string pbz, string pdeep, string place, string plength, string pnum, string psize,
                                            string pwidth, string qtcode, string qtcz, string qtname, string sid, string sjcode, string sjname,
                                            string slblcode, string slblname, string wjcode, string wjname, string ykcode, string ykcz, string yklxcz, string ykname, string yktbcz, string zsize
                                            )
        {
            string r = "";
            //bool tjFlag = false;
            List <B_GroupProduction> lbgp = new List <B_GroupProduction>();
            B_GroupProduction        ms   = new B_GroupProduction();
            B_GroupProduction        mt   = new B_GroupProduction();
            B_GroupProduction        ct   = new B_GroupProduction();
            B_GroupProduction        yk   = new B_GroupProduction();
            B_GroupProduction        wj   = new B_GroupProduction();
            B_GroupProduction        qt   = new B_GroupProduction();
            B_GroupProduction        bl   = new B_GroupProduction();
            B_GroupProduction        slbl = new B_GroupProduction();
            B_GroupProduction        sj   = new B_GroupProduction();
            B_GroupProduction        hj   = new B_GroupProduction();
            B_GroupProduction        mtb  = new B_GroupProduction();
            int    wjgnum = 1000;
            string egnum  = "0";

            invcate = invcate.Substring(8, 3);
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string             gsid = CommonBll.GetSid();
                Sys_SizeTransformR sc   = scb.Query(" and rcode='" + cavetype + "'");
                pbz = pbz.Replace(",", " ");
                if (gnum == "" || gnum == "0")
                {
                    egnum  = bgpb.GetGnum(" and sid='" + sid + "' and gnum<1000").ToString();
                    wjgnum = wjgnum + bgpb.GetGnum(" and sid='" + sid + "' and gnum>1000");
                    if (invcate == "004")
                    {
                        gnum = wjgnum.ToString();
                    }
                    else
                    {
                        gnum = egnum.ToString();
                    }
                }
                else
                {
                    if (invcate == "004" && Convert.ToInt32(gnum) < 1000)
                    {
                        wjgnum = wjgnum + bgpb.GetGnum(" and sid='" + sid + "' and gnum>1000");
                    }
                    if (invcate != "004" && Convert.ToInt32(gnum) >= 1000)
                    {
                        egnum = bgpb.GetGnum(" and sid='" + sid + "' and gnum<1000").ToString();
                    }
                    if (invcate == "004" && Convert.ToInt32(gnum) >= 1000)
                    {
                        wjgnum = Convert.ToInt32(gnum);
                    }
                    if (invcate != "004" && Convert.ToInt32(gnum) < 1000)
                    {
                        egnum = gnum;
                    }
                }
                #region//门扇
                if (mscode != "")
                {
                    Sys_InventoryDetail ims = sidb.Query(" and icode='" + mscode + "'");
                    Sys_ProduceImg      spi = spib.QueryInvImg(mscode);
                    ms.sid         = sid;
                    ms.tsid        = "";
                    ms.gsid        = gsid;
                    ms.psid        = CommonBll.GetSid();
                    ms.itype       = invcate;
                    ms.fix         = fix;
                    ms.direction   = direction;
                    ms.place       = place;
                    ms.inum        = Convert.ToDecimal(pnum);
                    ms.gnum        = Convert.ToInt32(egnum);
                    ms.locktype    = locktype;
                    ms.mname       = mscz;
                    ms.icode       = mscode;
                    ms.iname       = msname;
                    ms.uname       = ims == null ? "" : ims.iunit;
                    ms.height      = Convert.ToInt32(plength);
                    ms.width       = Convert.ToInt32(pwidth);
                    ms.deep        = Convert.ToInt32(pdeep);
                    ms.fsize       = Convert.ToInt32(psize);
                    ms.zsize       = Convert.ToInt32(zsize);
                    ms.maker       = iv.u.ename;
                    ms.ptype       = "ms";
                    ms.isjc        = isjc;
                    ms.allprice    = 0;
                    ms.serverprice = 0;
                    ms.cdate       = DateTime.Now.ToString();
                    ms.locks       = locks;
                    ms.floor       = floor;
                    ms.msts        = msts;
                    if (spi != null)
                    {
                        ms.pic     = spi.iurl;
                        ms.picname = spi.iname;
                    }
                    else
                    {
                        ms.pic     = "";
                        ms.picname = "";
                    }
                    ms.idiscount = bsdb.CheckDiscount(sid, mscode) == true ? 1 : 0;
                    ms.czyy      = smcb.QueryEx(mscode);
                    ms.zjname    = "";
                    ms.zjcode    = "";
                    ms.zjmname   = "";
                    ms.zsize     = 0;
                    ms.tbcz      = "";
                    ms.lxcz      = "";
                    if (mscode != "")
                    {
                        ms.ps = srb.QueryGByIcode(mscode) + pbz.Replace(",", ",");
                    }
                    if (sc != null)
                    {
                        ms.cavecode = sc.rcode;
                        ms.cavename = sc.rname;
                    }
                }
                #endregion
                #region//门套
                if (mtcode != "")
                {
                    Sys_InventoryDetail imt = sidb.Query(" and icode='" + mtcode + "'");
                    mt.sid         = sid;
                    mt.gsid        = gsid;
                    mt.tsid        = "";
                    mt.psid        = CommonBll.GetSid();
                    mt.itype       = invcate;
                    mt.fix         = fix;
                    mt.direction   = direction;
                    mt.place       = place;
                    mt.inum        = Convert.ToDecimal(pnum);
                    mt.gnum        = Convert.ToInt32(egnum);
                    mt.locktype    = locktype;
                    mt.mname       = mtcz;
                    mt.icode       = mtcode;
                    mt.iname       = mtname;
                    mt.ptype       = "mt";
                    mt.isjc        = isjc;
                    mt.uname       = imt == null ? "" : imt.iunit;
                    mt.height      = Convert.ToInt32(plength);
                    mt.width       = Convert.ToInt32(pwidth);
                    mt.deep        = Convert.ToInt32(pdeep);
                    mt.fsize       = Convert.ToInt32(psize);
                    mt.zsize       = Convert.ToInt32(zsize);
                    mt.maker       = iv.u.ename;
                    mt.locks       = locks;
                    mt.allprice    = 0;
                    mt.tbcz        = mttbcz;
                    mt.lxcz        = mtlxcz;
                    mt.serverprice = 0;
                    mt.cdate       = DateTime.Now.ToString();
                    mt.idiscount   = bsdb.CheckDiscount(sid, mtcode) == true ? 1 : 0;
                    mt.floor       = floor;
                    mt.mtts        = mtts;
                    if (slblcode != "")
                    {
                        mt.zjname  = slblname;
                        mt.zjcode  = slblcode;
                        mt.zjmname = "";
                    }
                    if (mtbcode != "")
                    {
                        mt.zjname  = mtbname;
                        mt.zjcode  = mtbcode;
                        mt.zjmname = mtbcz;
                    }
                    if (mtcode != "")
                    {
                        mt.ps = pbz.Replace(",", ",");
                    }
                }
                #endregion
                #region//窗套
                if (ctcode != "")
                {
                    Sys_InventoryDetail ict = sidb.Query(" and icode='" + ctcode + "'");
                    ct.sid         = sid;
                    ct.tsid        = "";
                    ct.gsid        = gsid;
                    ct.psid        = CommonBll.GetSid();
                    ct.itype       = invcate;
                    ct.fix         = fix;
                    ct.direction   = direction;
                    ct.place       = place;
                    ct.inum        = Convert.ToDecimal(pnum);
                    ct.gnum        = Convert.ToInt32(egnum);
                    ct.locktype    = locktype;
                    ct.mname       = ctcz;
                    ct.icode       = ctcode;
                    ct.iname       = ctname;
                    ct.ptype       = "ct";
                    ct.isjc        = isjc;
                    ct.uname       = ict == null ? "" : ict.iunit;
                    ct.height      = Convert.ToInt32(plength);
                    ct.width       = Convert.ToInt32(pwidth);
                    ct.deep        = Convert.ToInt32(pdeep);
                    ct.fsize       = Convert.ToInt32(psize);
                    ct.allprice    = 0;
                    ct.serverprice = 0;
                    ct.maker       = iv.u.ename;
                    ct.cdate       = DateTime.Now.ToString();
                    ct.idiscount   = bsdb.CheckDiscount(sid, ctcode) == true ? 1 : 0;
                    ct.zjname      = "";
                    ct.zjcode      = "";
                    ct.zjmname     = "";
                    ct.zsize       = 0;
                    ct.tbcz        = cttbcz;
                    ct.lxcz        = ctlxcz;
                    ct.floor       = floor;
                    if (ctcode != "")
                    {
                        ct.ps = srb.QueryGByIcode(ctcode) + pbz;
                    }
                }
                #endregion
                #region//垭口
                if (ykcode != "")
                {
                    Sys_InventoryDetail iyk = sidb.Query(" and icode='" + ykcode + "'");
                    yk.sid         = sid;
                    yk.tsid        = "";
                    yk.gsid        = gsid;
                    yk.psid        = CommonBll.GetSid();
                    yk.itype       = invcate;
                    yk.fix         = fix;
                    yk.direction   = direction;
                    yk.place       = place;
                    yk.inum        = Convert.ToDecimal(pnum);
                    yk.gnum        = Convert.ToInt32(egnum);
                    yk.locktype    = locktype;
                    yk.mname       = ykcz;
                    yk.icode       = ykcode;
                    yk.iname       = ykname;
                    yk.ptype       = "yk";
                    yk.isjc        = isjc;
                    yk.uname       = iyk == null ? "" : iyk.iunit;
                    yk.height      = Convert.ToInt32(plength);
                    yk.width       = Convert.ToInt32(pwidth);
                    yk.deep        = Convert.ToInt32(pdeep);
                    yk.fsize       = Convert.ToInt32(psize);
                    yk.maker       = iv.u.ename;
                    yk.allprice    = 0;
                    yk.serverprice = 0;
                    yk.cdate       = DateTime.Now.ToString();
                    yk.idiscount   = bsdb.CheckDiscount(sid, ykcode) == true ? 1 : 0;
                    yk.zjname      = "";
                    yk.zjcode      = "";
                    yk.zjmname     = "";
                    yk.zsize       = 0;
                    yk.tbcz        = yktbcz;
                    yk.lxcz        = yklxcz;
                    yk.floor       = floor;
                    if (ykcode != "")
                    {
                        yk.ps = srb.QueryGByIcode(ykcode) + pbz;
                    }
                }
                #endregion
                #region//玻璃
                if (blcode != "")
                {
                    Sys_InventoryDetail ibl = sidb.Query(" and icode='" + blcode + "'");
                    bl.sid         = sid;
                    bl.tsid        = "";
                    bl.gsid        = gsid;
                    bl.psid        = CommonBll.GetSid();
                    bl.itype       = invcate;
                    bl.fix         = fix;
                    bl.direction   = direction;
                    bl.place       = place;
                    bl.inum        = Convert.ToDecimal(pnum);
                    bl.gnum        = Convert.ToInt32(egnum);
                    bl.locktype    = locktype;
                    bl.mname       = "";
                    bl.icode       = blcode;
                    bl.iname       = blname;
                    bl.height      = 0;
                    bl.width       = 0;
                    bl.deep        = 0;
                    bl.fsize       = 0;
                    bl.ptype       = "bl";
                    bl.isjc        = isjc;
                    bl.uname       = ibl == null ? "" : ibl.iunit;
                    bl.maker       = iv.u.ename;
                    bl.allprice    = 0;
                    bl.serverprice = 0;
                    bl.cdate       = DateTime.Now.ToString();
                    bl.idiscount   = bsdb.CheckDiscount(sid, blcode) == true ? 1 : 0;
                    bl.zjname      = "";
                    bl.zjcode      = "";
                    bl.zjmname     = "";
                    bl.zsize       = 0;
                    bl.tbcz        = "";
                    bl.lxcz        = "";
                    bl.floor       = floor;
                    if (blcode != "")
                    {
                        bl.ps = srb.QueryGByIcode(blcode) + pbz;
                    }
                }
                #endregion
                #region//锁具
                if (sjcode != "")
                {
                    Sys_InventoryDetail isj = sidb.Query(" and icode='" + sjcode + "'");
                    sj.sid         = sid;
                    sj.tsid        = "";
                    sj.gsid        = gsid;
                    sj.psid        = CommonBll.GetSid();
                    sj.itype       = invcate;
                    sj.fix         = fix;
                    sj.direction   = direction;
                    sj.place       = place;
                    sj.inum        = Convert.ToDecimal(pnum);
                    sj.gnum        = Convert.ToInt32(egnum);
                    sj.locktype    = locktype;
                    sj.mname       = "";
                    sj.ptype       = "sj";
                    sj.icode       = sjcode;
                    sj.iname       = sjname;
                    sj.uname       = isj == null ? "" : isj.iunit;
                    sj.height      = 0;
                    sj.width       = 0;
                    sj.deep        = 0;
                    sj.fsize       = 0;
                    sj.isjc        = isjc;
                    sj.allprice    = 0;
                    sj.serverprice = 0;
                    sj.maker       = iv.u.ename;
                    sj.cdate       = DateTime.Now.ToString();
                    sj.idiscount   = bsdb.CheckDiscount(sid, sjcode) == true ? 1 : 0;
                    sj.zjname      = "";
                    sj.zjcode      = "";
                    sj.zjmname     = "";
                    sj.zsize       = 0;
                    sj.tbcz        = "";
                    sj.lxcz        = "";
                    sj.floor       = floor;
                    if (sjcode != "")
                    {
                        sj.ps = srb.QueryGByIcode(sjcode) + pbz;
                    }
                }
                #endregion
                #region//五金
                if (wjcode != "")
                {
                    Sys_InventoryDetail iwj = sidb.Query(" and icode='" + wjcode + "'");
                    wj.sid         = sid;
                    wj.tsid        = "";
                    wj.gsid        = gsid;
                    wj.psid        = CommonBll.GetSid();
                    wj.itype       = invcate;
                    wj.fix         = fix;
                    wj.direction   = direction;
                    wj.place       = place;
                    wj.inum        = Convert.ToDecimal(pnum);
                    wj.gnum        = Convert.ToInt32(wjgnum);
                    wj.locktype    = locktype;
                    wj.mname       = "";
                    wj.icode       = wjcode;
                    wj.iname       = wjname;
                    wj.height      = 0;
                    wj.ptype       = "wj";
                    wj.width       = 0;
                    wj.deep        = 0;
                    wj.fsize       = 0;
                    wj.isjc        = isjc;
                    wj.allprice    = 0;
                    wj.serverprice = 0;
                    wj.uname       = iwj == null ? "" : iwj.iunit;
                    wj.maker       = iv.u.ename;
                    wj.cdate       = DateTime.Now.ToString();
                    if (wjcode != "")
                    {
                        wj.ps = srb.QueryGByIcode(wjcode) + pbz;
                    }
                    wj.zjname    = "";
                    wj.zjcode    = "";
                    wj.zjmname   = "";
                    wj.zsize     = 0;
                    wj.tbcz      = "";
                    wj.lxcz      = "";
                    wj.idiscount = bsdb.CheckDiscount(sid, wjcode) == true ? 1 : 0;
                    wj.floor     = floor;
                }
                #endregion
                #region//护角
                if (hjcode != "")
                {
                    Sys_InventoryDetail ihj = sidb.Query(" and icode='" + hjcode + "'");
                    hj.sid         = sid;
                    hj.tsid        = "";
                    hj.gsid        = gsid;
                    hj.psid        = CommonBll.GetSid();
                    hj.itype       = invcate;
                    hj.fix         = fix;
                    hj.direction   = direction;
                    hj.place       = place;
                    hj.inum        = Convert.ToDecimal(pnum);
                    hj.gnum        = Convert.ToInt32(egnum);
                    hj.locktype    = locktype;
                    hj.mname       = hjcz;
                    hj.icode       = hjcode;
                    hj.iname       = hjname;
                    hj.uname       = ihj == null ? "" : ihj.iunit;
                    hj.ptype       = "hj";
                    hj.isjc        = isjc;
                    hj.height      = Convert.ToInt32(plength);
                    hj.width       = Convert.ToInt32(pwidth);
                    hj.deep        = Convert.ToInt32(pdeep);
                    hj.fsize       = Convert.ToInt32(psize);
                    hj.allprice    = 0;
                    hj.serverprice = 0;
                    hj.maker       = iv.u.ename;
                    hj.cdate       = DateTime.Now.ToString();
                    hj.idiscount   = bsdb.CheckDiscount(sid, hjcode) == true ? 1 : 0;
                    hj.zjname      = "";
                    hj.zjcode      = "";
                    hj.zjmname     = "";
                    hj.zsize       = 0;
                    hj.tbcz        = "";
                    hj.lxcz        = "";
                    hj.floor       = floor;
                    if (hjcode != "")
                    {
                        hj.ps = srb.QueryGByIcode(hjcode) + pbz;
                    }
                }
                #endregion
                #region//其他
                if (qtcode != "")
                {
                    Sys_InventoryDetail iqt = sidb.Query(" and icode='" + qtcode + "'");
                    qt.sid         = sid;
                    qt.tsid        = "";
                    qt.gsid        = gsid;
                    qt.psid        = CommonBll.GetSid();
                    qt.itype       = invcate;
                    qt.fix         = fix;
                    qt.direction   = direction;
                    qt.place       = place;
                    qt.inum        = Convert.ToDecimal(pnum);
                    qt.gnum        = Convert.ToInt32(egnum);
                    qt.locktype    = locktype;
                    qt.mname       = qtcz;
                    qt.icode       = qtcode;
                    qt.iname       = qtname;
                    qt.ptype       = "qt";
                    qt.isjc        = isjc;
                    qt.uname       = iqt == null ? "" : iqt.iunit;
                    qt.height      = Convert.ToInt32(plength);
                    qt.width       = Convert.ToInt32(pwidth);
                    qt.deep        = Convert.ToInt32(pdeep);
                    qt.fsize       = Convert.ToInt32(psize);
                    qt.allprice    = 0;
                    qt.serverprice = 0;
                    qt.maker       = iv.u.ename;
                    qt.cdate       = DateTime.Now.ToString();
                    if (qtcode != "")
                    {
                        qt.ps = srb.QueryGByIcode(qtcode) + pbz;
                    }
                    qt.zjname    = "";
                    qt.zjcode    = "";
                    qt.zjmname   = "";
                    qt.zsize     = 0;
                    qt.tbcz      = "";
                    qt.lxcz      = "";
                    qt.idiscount = bsdb.CheckDiscount(sid, qtcode) == true ? 1 : 0;
                    qt.floor     = floor;
                }
                #endregion
                if (invcate == "010")
                {
                    lbgp.Add(ms);
                    lbgp.Add(mt);
                    lbgp.Add(sj);
                    lbgp.Add(bl);
                    lbgp.Add(slbl);
                    lbgp.Add(mtb);
                }
                if (invcate == "001")
                {
                    lbgp.Add(ms);
                    lbgp.Add(bl);
                }
                if (invcate == "002")
                {
                    lbgp.Add(mt);
                    lbgp.Add(slbl);
                    lbgp.Add(mtb);
                }
                if (invcate == "006")
                {
                    lbgp.Add(ct);
                }
                if (invcate == "004")
                {
                    lbgp.Add(wj);
                }
                if (invcate == "005")
                {
                    lbgp.Add(bl);
                }
                if (invcate == "007")
                {
                    lbgp.Add(yk);
                }
                if (invcate == "008")
                {
                    lbgp.Add(hj);
                }
                if (invcate == "009")
                {
                    lbgp.Add(qt);
                }
                bgpmb.Delete(" and sid='" + sid + "' and gnum=" + gnum + "");
                if (bgpb.SaveList(lbgp, sid, Convert.ToInt32(gnum)) > 0)
                {
                    if (alist != "")
                    {
                        List <B_GroupProductionAttr> lbpa = new List <B_GroupProductionAttr>();
                        if (alist != null)
                        {
                            string[] pl = alist.Split(';');
                            for (int i = 0; i < pl.Length; i++)
                            {
                                Sys_ProductionAttrEx  spae = spab.Query(" and acode='" + pl[i] + "'");
                                B_GroupProductionAttr ba   = new B_GroupProductionAttr();
                                ba.sid    = sid;
                                ba.gsid   = gsid;
                                ba.acode  = spae.acode;
                                ba.aname  = spae.aname;
                                ba.amoney = spae.price;
                                ba.cdate  = DateTime.Now.ToString();
                                ba.maker  = iv.u.ename;
                                lbpa.Add(ba);
                            }
                            bgpab.AddList(lbpa, gsid);
                        }
                    }
                    if (invcate == "004")
                    {
                        bcpb.InvComputePrice(sid, Convert.ToInt32(wjgnum), iv.u.dcode, "gh");
                        r = "S";
                    }
                    else
                    {
                        bcpb.InvComputePrice(sid, Convert.ToInt32(egnum), iv.u.dcode, "gh");
                        r = "S";
                    }
                    bpib.SaveItemList(bistfb.CreateTranFormList(sid, Convert.ToInt32(gnum), iv.u.ename));
                }
                else
                {
                    r = "F";
                }
                if (optype == "f")
                {
                    r = gnum;
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #25
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);
        }
Beispiel #26
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 #27
0
        public static string AddProduction(string direction, string fixs, string ggy, string glasss, string gsize, string itype, string locks, string mname, string msname, string pd, string ph, string place, string pmsd, string pname, string pnum, string premark, string psid, string pw, string sid, string sitype, string stype)
        {
            string r = "";
            SessionUserValidate    iv = SysValidateBll.ValidateSession();
            B_AfterGroupProduction ao = new B_AfterGroupProduction();

            if (iv.f)
            {
                ao.direction = direction;
                ao.fixs      = fixs;
                ao.glass     = glasss;
                ao.gsize     = gsize;
                ao.height    = Convert.ToInt32(ph);
                ao.width     = Convert.ToInt32(pw);
                ao.deep      = Convert.ToInt32(pd);
                ao.iheight   = 0;
                ao.iwidth    = 0;
                ao.ideep     = 0;
                ao.pnum      = Convert.ToDecimal(pnum);
                ao.itype     = itype;
                ao.locks     = locks;
                ao.mname     = mname;
                ao.place     = place;
                ao.pname     = pname;
                ao.remark    = premark;
                ao.sid       = sid;
                ao.stype     = stype;
                ao.msname    = msname;
                ao.sitype    = sitype;
                ao.maker     = iv.u.ename;
                ao.ggy       = ggy;
                ao.pmsd      = pmsd;
                ao.cdate     = DateTime.Now.ToString();
                if (psid == "")
                {
                    ao.gnum = bagpb.GetGnum(" and sid='" + sid + "'");
                    ao.psid = CommonBll.GetSid();
                    if (bagpb.Add(ao) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    ao.psid = psid;
                    if (bagpb.Update(ao))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #28
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);
        }
Beispiel #29
0
        public static string SavePreParePartOrder(string sid, ArrayList itemlist, string remark)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_WjOrder bwp = bsob.Query(" and sid='" + sid + "'");
                if (bwp != null)
                {
                    bool op = true;
                    bool wp = true;
                    B_WjPreparePartOrder bwpo = new B_WjPreparePartOrder();
                    bwpo.cdate  = DateTime.Now.ToString();
                    bwpo.maker  = iv.u.ename;;
                    bwpo.osid   = bwp.msid;
                    bwpo.remark = remark;
                    bwpo.sid    = CommonBll.GetSid();
                    bwpo.wsid   = bwp.sid;
                    List <B_WjPreParePartGroupProduction> pbpp = new List <B_WjPreParePartGroupProduction>();
                    foreach (object[] al in itemlist)
                    {
                        B_WjPreParePartGroupProduction bpp = new B_WjPreParePartGroupProduction();
                        bpp.cdate = DateTime.Now.ToString();
                        bpp.icode = al[0].ToString();
                        bpp.iname = al[1].ToString();
                        bpp.maker = iv.u.ename;
                        bpp.osid  = bwp.msid;
                        bpp.sid   = bwpo.sid;
                        bpp.wsid  = bwpo.wsid;
                        if (Convert.ToDecimal(al[5].ToString()) + Convert.ToDecimal(al[4].ToString()) < Convert.ToDecimal(al[3].ToString()))
                        {
                            bpp.pnum = Convert.ToDecimal(al[5].ToString());
                            op       = false;
                        }
                        else
                        {
                            bpp.pnum = Convert.ToDecimal(al[3].ToString()) - Convert.ToDecimal(al[4].ToString());
                        }
                        if (Convert.ToDecimal(al[4].ToString()) > 0)
                        {
                            wp = false;
                        }
                        if (Convert.ToDecimal(al[5].ToString()) > 0)
                        {
                            bwpppgpb.Add(bpp);
                        }
                    }
                    if (op && wp)
                    {
                        bwpo.pcode = bwp.wcode;
                    }
                    else
                    {
                        bwpo.pcode = bwp.wcode + "-" + bwppb.GetOrderNum(sid).ToString().PadLeft(2, '0');
                    }
                    if (bwppb.Add(bwpo) > 0)
                    {
                        r = "S";
                        if (op)
                        {
                            cosb.UpState(sid, "iwjbh", 2);
                            cosb.UpState(bwp.osid, "iwjbh", 2);
                        }
                        else
                        {
                            cosb.UpState(sid, "iwjbh", 1);
                            cosb.UpState(bwp.osid, "iwjbh", 1);
                        }
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #30
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);
        }