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

            if (iv.f)
            {
                B_SaleMaterielOrder bso = bsob.Query(" and sid='" + sid + "'");
                VPayOrder           vpo = new VPayOrder();
                VOrderMoney         vm  = bomb.DoorOrderMoney(sid, 1, bso.gdiscount, 1);
                CB_OrderFlow        cof = bwfb.QueryAttrExWorkFlow(sid, "bj");
                vpo.code     = bso.scode;
                vpo.dname    = bso.dname;
                vpo.city     = bso.city;
                vpo.dcode    = bso.citycode;
                vpo.bjr      = cof != null ? cof.maker : "";
                vpo.yingshou = vm.godhjmoney.ToString();
                vpo.yishou   = vm.pmoney.ToString();
                vpo.weishou  = (vm.godhjmoney - vm.pmoney).ToString();
                r            = js.Serialize(vpo);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #2
0
        public static string QueryOrder(string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_SaleMaterielOrder bco = bsmob.Query(" and sid='" + sid + "'");
                if (bco != null)
                {
                    r = js.Serialize(bco);
                }
                else
                {
                    Sys_Depment         sd  = sdb.Query(" and dcode='" + iv.u.dcode + "'");
                    B_SaleMaterielOrder kco = new B_SaleMaterielOrder();
                    if (sd != null)
                    {
                        if (sd.dattr == "cs")
                        {
                            Sys_DepmentDpt sdd = sddb.Query(" and dcode='" + sd.dcode + "'");
                            kco.city       = sd.dpname;
                            kco.citycode   = sd.dpcode;
                            kco.dname      = sd.dname;
                            kco.dcode      = sd.dcode;
                            kco.stelephone = sdd != null ? sdd.dcontact : "";
                        }
                        else if (sd.dattr == "dm")
                        {
                            Sys_DepmentDpt sdd = sddb.Query(" and dcode='" + sd.dcode.Substring(0, sd.dcode.Length - 4) + "'");
                            kco.city       = sd.dpname;
                            kco.citycode   = sd.dpcode;
                            kco.dname      = sd.dname;
                            kco.dcode      = sd.dcode;
                            kco.stelephone = sdd != null ? sdd.dcontact : "";
                        }
                        else
                        {
                            kco.city     = "";
                            kco.citycode = "";
                            kco.dname    = "";
                            kco.dcode    = "";
                        }
                    }
                    kco.maker = iv.u.ename;
                    r         = js.Serialize(kco);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #3
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);
        }
Beispiel #4
0
        public static string SaveOrder(string bcode, string city, string citycode, string dcode, string dname, string emcode, string maker, string otype, string remark, string saddress, string sid, string sperson, string stelephone, string wltype)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                B_SaleMaterielOrder bco = new B_SaleMaterielOrder();
                bco.acode      = "";
                bco.aname      = "";
                bco.bdcode     = "";
                bco.cdate      = DateTime.Now.ToString();
                bco.city       = city;
                bco.citycode   = citycode;
                bco.dcode      = dcode;
                bco.dname      = dname;
                bco.gdiscount  = 1;
                bco.maker      = maker;
                bco.otype      = otype;
                bco.remark     = remark;
                bco.saddress   = saddress;
                bco.stelephone = stelephone;
                bco.qtimg      = "";
                bco.sperson    = sperson;
                bco.wltype     = wltype;
                bco.bdcode     = "00010001";
                if (sid == "")
                {
                    bco.sid = CommonBll.GetSid();
                    if (bsmob.Add(bco) > 0)
                    {
                        CB_OrderState cos = new CB_OrderState();
                        cos.sid = bco.sid;
                        cosb.Add(cos);
                        bwfb.CreateWorkFlow(bco.sid, emcode);
                        r = bco.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    bco.sid = sid;
                    if (bsmob.Update(bco))
                    {
                        r = bco.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                }
                EventBtnDo.FireEventBtn(bco.sid, bcode, "1", "订单保存");
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }