Пример #1
0
        public static string AfterProductionOrder(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                VProduceOrder      vpo = new VProduceOrder();
                B_YqAfterSaleOrder 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.pcode;
                vpo.customer = bso.customer;
                vpo.address  = bso.address;
                vpo.dname    = bso.dname;
                vpo.otype    = "售后单";
                vpo.fname    = bof == null ? "" : bof.dname;
                vpo.scdate   = cof.edate;
                vpo.overdate = bof == null ? "" : bof.overdate;
                vpo.bz       = bso.remark;
                vpo.duty     = bso.aduty;
                vpo.reason   = bso.areason;
                vpo.city     = bso.city;
                r            = js.Serialize(vpo);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Пример #2
0
        public static string AfterSalePayOperator(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                VPayOrder          vpo      = new VPayOrder();
                B_YqAfterSaleOrder bso      = bsob.Query(" and sid='" + sid + "'");
                decimal            yingshou = bso.omoney;
                decimal            yishou   = bprb.GetSkMoney(sid);
                vpo.code      = bso.scode;
                vpo.customer  = bso.customer;
                vpo.dname     = bso.dname;
                vpo.settlment = "";
                vpo.yingshou  = yingshou.ToString();
                vpo.yishou    = yishou.ToString();
                vpo.weishou   = (yingshou - yishou).ToString();
                r             = js.Serialize(vpo);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Пример #3
0
        public static string SaveFactory(string bcode, string fcode, string fline, string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                int                   dn   = 0;
                Sys_Depment           sd   = sdb.Query(" and dcode='" + fcode + "'");
                B_OrderFacotory       bf   = new B_OrderFacotory();
                B_YqAfterSaleOrder    baso = bsob.Query(" and sid='" + sid + "'");
                B_OrderFacotory       bof  = bofb.Query(" and sid='" + sid + "'");
                List <Sys_ProduceCyc> lc   = spcb.QueryCheckList(" and emcode='0006' and dcode='" + fcode + "'");
                if (lc != null)
                {
                    dn = lc[0].cnum;
                }
                bf.dname    = sd != null ? sd.dname : "";
                bf.dcode    = fcode;
                bf.maker    = iv.u.ename;
                bf.sid      = sid;
                bf.overdate = DateTime.Now.AddDays(dn).ToString("yyyy-MM-dd");
                bf.otype    = baso == null ? "" : baso.otype;
                bf.cdate    = DateTime.Now.ToString();
                if (bof != null)
                {
                    if (bofb.Update(bf))
                    {
                        r = "S";
                        bppb.SetProduceProcess(sid, fline);
                        BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(sid, bcode, "1", "分单");
                        //bcpb.OrderCgComputePrice(sid);
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (bofb.Add(bf) > 0)
                    {
                        r = "S";
                        bppb.SetProduceProcess(sid, fline);
                        BaseSet.WorkFlowManage.EventBtnDo.FireEventBtn(sid, bcode, "1", "分单");
                        //bcpb.OrderCgComputePrice(sid);
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Пример #4
0
        public static string InHouseOrder(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                VInHouseOrder      vpo = new VInHouseOrder();
                B_YqAfterSaleOrder 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.pcode;
                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);
        }
Пример #5
0
        public static string InitAfterOrder(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();
            B_YqAfterSaleOrder  ao = new B_YqAfterSaleOrder();
            Sys_Depment         sd = sdb.Query(" and dcode='" + iv.u.dcode + "'");

            if (iv.f)
            {
                ao       = basob.Query(" and sid='" + sid + "'");
                ao.cdate = CommonBll.GetBdate(ao.cdate);
                // ao.ztimg = bosb.QueryOrderStateImg(sid);
                r = js.Serialize(ao);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Пример #6
0
        public static string InitAddAfterOrder(string sid, string m)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();
            B_YqAfterSaleOrder  ao = new B_YqAfterSaleOrder();

            if (iv.f)
            {
                #region//存在原单
                if (sid != "")
                {
                    B_YqAfterSaleOrder aso = basob.Query(" and sid='" + sid + "'");
                    if (aso != null)
                    {
                        if (m == "a")
                        {
                            ao = aso;
                        }
                        else
                        {
                            aso.osid  = aso.sid;
                            aso.sid   = "";
                            aso.id    = 0;
                            aso.otype = "售后反馈";
                            ao        = aso;
                        }
                    }
                    B_YqSaleOrder bso = sbs.Query(" and sid='" + sid + "'");
                    if (bso != null)
                    {
                        ao.id        = 0;
                        ao.sid       = "";
                        ao.osid      = bso.sid;
                        ao.customer  = bso.customer;
                        ao.telephone = bso.telephone;
                        ao.address   = bso.address;
                        ao.pcode     = bso.scode;
                        ao.dcode     = bso.dcode;
                        ao.dname     = bso.dname;
                        ao.city      = bso.city;
                        ao.citytype  = bso.citytype;
                        ao.citycode  = bso.citycode;
                        ao.maker     = iv.u.ename;;
                        ao.mname     = bso.mname;
                        ao.source    = "";
                        ao.aduty     = "";
                        ao.areason   = "";
                        ao.remark    = "";
                        ao.method    = "";
                        ao.otype     = "木门反馈";
                        ao.wlcompany = bso.wlcompany;
                    }
                }
                #endregion
                #region//不存在原单
                if (sid == "")
                {
                    Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                    ao.id       = 0;
                    ao.dcode    = iv.u.dcode;
                    ao.dname    = iv.u.dname;
                    ao.city     = sd.dpname;
                    ao.citytype = "";
                    ao.citycode = sd.dpcode;
                    ao.maker    = iv.u.ename;
                }
                #endregion
                r = js.Serialize(ao);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Пример #7
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);
        }