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

            if (iv.f)
            {
                VProduceOrder   vpo = new VProduceOrder();
                B_MzSaleOrder   bso = bsob.Query(" and sid='" + sid + "'");
                CB_OrderFlow    cof = bwfb.QueryAttrExWorkFlow(sid, "sc");
                B_OrderFacotory bof = bofb.Query(" and sid='" + sid + "'");
                vpo.code     = bso.scode;
                vpo.ycode    = bso.ycode;
                vpo.customer = bso.customer;
                vpo.address  = bso.address;
                vpo.dname    = bso.dname;
                vpo.otype    = bso.otype;
                vpo.fname    = bof == null ? "" : bof.dname;
                vpo.scdate   = cof != null ? cof.edate : "";
                vpo.overdate = bof == null ? "" : bof.overdate;
                vpo.bz       = bso.remark;
                r            = js.Serialize(vpo);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #2
0
        public static string MzPayOperator(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                VPayOrder     vpo      = new VPayOrder();
                B_MzSaleOrder bso      = bsob.Query(" and sid='" + sid + "'");
                decimal       yingshou = bso.omoney;
                decimal       yishou   = bprb.GetSkMoneyEx(" and sid='" + sid + "'");
                CB_OrderFlow  cof      = bwfb.QueryAttrExWorkFlow(sid, "bj");
                vpo.code     = bso.scode;
                vpo.customer = bso.customer;
                vpo.dname    = bso.dname;
                //vpo.settlment = bso.sname;
                vpo.bjr       = cof != null ? cof.maker : "";
                vpo.yingshou  = yingshou.ToString("#0.00");
                vpo.yishou    = yishou.ToString();
                vpo.weishou   = (yingshou - yishou).ToString("#0.00");
                vpo.telephone = bso.telephone;
                r             = js.Serialize(vpo);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #3
0
        public static string QueryMzOrder(string sid)
        {
            string              r   = "";
            B_MzSaleOrder       bms = new B_MzSaleOrder();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (sid == "")
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                    bms.id       = 0;
                    bms.city     = sd.dpname;
                    bms.citycode = sd.dpcode;
                    bms.dcode    = iv.u.dcode;
                    bms.dname    = iv.u.dname;
                    bms.maker    = iv.u.ename;
                }
                else
                {
                    bms = bmsob.Query("and sid='" + sid + "'");
                    //bms.ztimg = bosb.QueryOrderStateImg(sid);
                }
                r = js.Serialize(bms);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #4
0
        public static string SetOrderDesigner(string sid, string dv)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_MzSaleOrder bo = bmsob.Query(" and sid='" + sid + "'");
                if (bo != null)
                {
                    bmsob.SetDesign(sid, dv);
                    B_MzDesignTask bmdt = new B_MzDesignTask();
                    bmdt.sid      = sid;
                    bmdt.curstate = true;
                    bmdt.designer = dv;
                    bmdt.dstate   = 0;
                    bmdt.maker    = iv.u.ename;
                    bmdt.cdate    = DateTime.Now.ToString();
                    if (bmdtb.Exists(" and sid='" + sid + "' and designer='" + dv + "'"))
                    {
                        if (bmdtb.Update(bmdt))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                    else
                    {
                        //bmdtb.Delete(" and sid='" + sid + "'");
                        if (bmdtb.Add(bmdt) > 0)
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #5
0
        public static string MzInHouseOrder(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                VInHouseOrder   vpo  = new VInHouseOrder();
                B_MzSaleOrder   bso  = bsob.Query(" and sid='" + sid + "'");
                B_OrderFacotory bof  = bofb.Query(" and sid='" + sid + "'");
                CB_OrderState   cos  = cosb.Query(" and sid='" + sid + "'");
                int             bnum = bohrb.GetRecordCount(" sid='" + sid + "'");
                string          zt   = "";
                if (cos != null)
                {
                    if (cos.istoreget == 0)
                    {
                        zt = "未入库";
                    }
                    if (cos.istoreget == 1)
                    {
                        zt = "部分入库";
                    }
                    if (cos.istoreget == 2)
                    {
                        zt = "全部入库";
                    }
                }
                vpo.code      = bso.scode;
                vpo.ycode     = bso.ycode;
                vpo.customer  = bso.customer;
                vpo.address   = bso.address;
                vpo.dname     = bso.dname;
                vpo.fname     = bof == null ? "" : bof.dname;
                vpo.bz        = bso.remark;
                vpo.city      = bso.city;
                vpo.telephone = bso.telephone;
                vpo.bnum      = bnum.ToString();
                vpo.zt        = zt;
                r             = js.Serialize(vpo);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #6
0
        public static string QueryOrderType(string sid, string attr)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_MzSaleOrder bms = bmsob.Query("and sid='" + sid + "'");
                if (bms != null)
                {
                    Sys_MzOrderType smot = smotb.Query(" and mtname='" + bms.dtype + "' and otype='" + attr + "'");
                    r = smot != null ? smot.emcode : "";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #7
0
        public static string SaveOrder(string address, string bcode, string city, string citycode, string community, string customer, string dcode, string designer, string dname, string emcode, string id, string maker, string mname, string precode, string remark, string saletelephone, string sid, string source, string telephone, string zbdesigner)
        {
            string              r   = "";
            B_MzSaleOrder       bms = new B_MzSaleOrder();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                bms.acode      = "";
                bms.aname      = "";
                bms.address    = address;
                bms.community  = community;
                bms.city       = city;
                bms.citycode   = citycode;
                bms.customer   = customer;
                bms.dname      = dname;
                bms.dcode      = dcode;
                bms.designer   = designer;
                bms.maker      = iv.u.ename;
                bms.mname      = mname;
                bms.ycode      = precode;
                bms.remark     = remark;
                bms.source     = source;
                bms.telephone  = telephone;
                bms.zbdesigner = zbdesigner;
                bms.cdate      = DateTime.Now.ToString();
                if (id == "0")
                {
                    bms.sid = CommonBll.GetSid();
                    CB_OrderState cos = new CB_OrderState();
                    if (bmsob.Add(bms) > 0)
                    {
                        bwfb.CreateWorkFlow(bms.sid, emcode);
                        cos.sid = bms.sid;
                        cosb.Add(cos);
                        if (!bcb.Exists(" and telephone='" + telephone + "'"))
                        {
                            B_Customer bc = new B_Customer();
                            bc.dname     = bms.dname;
                            bc.dcode     = bms.dcode;
                            bc.customer  = bms.customer;
                            bc.telephone = bms.telephone;
                            bc.community = bms.community;
                            bc.address   = bms.address;
                            bc.cdate     = DateTime.Now.ToString();
                            bc.maker     = bms.maker;
                            bcb.Add(bc);
                        }
                        r = bms.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    bms.sid = sid;
                    if (bmsob.Update(bms))
                    {
                        r = bms.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #8
0
        public static string SetOrderCode(string sid, string code)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r = "F";
                B_SaleOrder bso = bsob.Query(" and sid='" + sid + "'");
                if (bso != null)
                {
                    if (bsob.Exists(" and scode='" + code + "' and sid!='" + sid + "'"))
                    {
                        r = "T";
                    }
                    else
                    {
                        if (bsob.SetOrderCode(sid, code))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                }
                B_YqSaleOrder ybso = ybsob.Query(" and sid='" + sid + "'");
                if (ybso != null)
                {
                    if (ybsob.Exists(" and scode='" + code + "' and sid!='" + sid + "'"))
                    {
                        r = "T";
                    }
                    else
                    {
                        if (ybsob.SetOrderCode(sid, code))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                }
                B_AfterSaleOrder baso = basob.Query(" and sid='" + sid + "'");
                if (baso != null)
                {
                    if (basob.Exists(" and scode='" + code + "' and sid!='" + sid + "'"))
                    {
                        r = "T";
                    }
                    else
                    {
                        r = "S";
                        //if (basob.SetOrderCode(sid, code))
                        //{
                        //    r = "S";
                        //}
                        //else
                        //{
                        //    r = "F";
                        //}
                    }
                }
                B_MzSaleOrder bmso = bmsob.Query(" and sid='" + sid + "'");
                if (bmso != null)
                {
                    if (bmsob.Exists(" and scode='" + code + "' and sid!='" + sid + "'"))
                    {
                        r = "T";
                    }
                    else
                    {
                        if (bmsob.SetOrderCode(sid, code))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                }
                B_SaleMaterielOrder bswo = bswob.Query(" and sid='" + sid + "'");
                if (bswo != null)
                {
                    if (bswob.Exists(" and scode='" + code + "' and sid!='" + sid + "'"))
                    {
                        r = "T";
                    }
                    else
                    {
                        if (bswob.SetOrderCode(sid, code))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }