Esempio n. 1
0
        public static string InitAddOrder(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();
            B_AfterApplyOrder   ao = new B_AfterApplyOrder();

            if (iv.f)
            {
                #region//存在原单
                if (sid != "")
                {
                    ao = bsob.Query(" and sid='" + sid + "'");
                }
                #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.citycode = sd.dpcode;
                    ao.maker    = iv.u.ename;
                }
                #endregion
                r = js.Serialize(ao);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Esempio n. 2
0
        public static string InitAddOrder(string sid, string asid)
        {
            string r = "";
            SessionUserValidate  iv = SysValidateBll.ValidateSession();
            B_AfterFreeBackOrder ao = new B_AfterFreeBackOrder();

            if (iv.f)
            {
                #region//存在原单
                if (sid != "")
                {
                    ao = bsob.Query(" and sid='" + sid + "'");
                }
                #endregion
                #region//不存在原单
                if (sid == "")
                {
                    if (asid != "")
                    {
                        B_AfterApplyOrder aao = basob.Query(" and sid='" + asid + "'");
                        if (aao != null)
                        {
                            ao.id        = 0;
                            ao.dcode     = aao.dcode;
                            ao.acity     = aao.acity;
                            ao.aprovince = aao.aprovince;
                            ao.sscode    = aao.scode;
                            ao.address   = aao.address;
                            ao.areason   = aao.areason;
                            ao.customer  = aao.customer;
                            ao.oscode    = aao.oscode;
                            ao.osid      = aao.osid;
                            ao.asid      = aao.sid;
                            ao.stext     = aao.remark;
                            ao.telephone = aao.telephone;
                            ao.maker     = iv.u.ename;
                        }
                    }
                    else
                    {
                        ao.maker = iv.u.ename;
                    }
                }
                #endregion
                r = js.Serialize(ao);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Esempio n. 3
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);
        }