Example #1
0
        public JsonResult InitCAccount(string id)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sbk_CollectionAccount sal = new Sbk_CollectionAccount();
                if (id != "")
                {
                    sal = sab.Query(" and  id='" + id + "'");
                }
                else
                {
                    sal.id    = 0;
                    sal.bcode = sab.CreateCode().ToString().PadLeft(4, '0');
                }
                d.d = js.Serialize(sal);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Example #2
0
        public JsonResult SaveCAccount(string abank, string acode, string aname, string aperson, string id, string remark, string subbank)
        {
            JsonData d = new JsonData();
            Sbk_CollectionAccount sa = new Sbk_CollectionAccount();
            SessionUserValidate   iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sa.aname    = aname;
                sa.abank    = abank;
                sa.aperson  = aperson;
                sa.acode    = acode;
                sa.asubbank = subbank;
                sa.remark   = remark;
                sa.maker    = iv.u.ename;
                sa.cdate    = DateTime.Now.ToString();
                if (id == "0")
                {
                    if (sab.Add(sa) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (sab.Update(sa))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
Example #3
0
        public static string SaveOrder(string account, string bcode, string city, string citycode, string emcode, string maker, string paccount, string pdate, string pmethod, string pmoney, string remark, string sid)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sbk_PaymentAccount    pa  = spab.Query(" and pcode=" + paccount + "");
                Sbk_CollectionAccount ca  = scab.Query(" and id=" + account + "");
                B_CityPayOrder        bco = new B_CityPayOrder();
                bco.caccount = ca.aname;
                bco.cbank    = ca.abank;
                bco.cperson  = ca.aperson;
                bco.cbcode   = ca.bcode;
                bco.ctype    = "";
                bco.dcode    = citycode;
                bco.dname    = city;
                bco.maker    = maker;
                bco.paccount = pa.pname;
                bco.pbank    = pa.pbank;
                bco.pbcode   = pa.pbcode;
                bco.sacode   = pa.sacode;
                bco.pcode    = "P" + DateTime.Now.ToString("yyyyMMddHHmmss");
                bco.pdate    = pdate;
                bco.pmethod  = pmethod;
                bco.pmoney   = Convert.ToDecimal(pmoney);
                bco.pperson  = pa.pperson;
                bco.pstate   = 0;
                bco.remark   = remark.Replace(",", ",");
                bco.maker    = maker;
                bco.cdate    = DateTime.Now.ToString();
                if (sid == "")
                {
                    CB_OrderState cos = new CB_OrderState();
                    bco.sid  = CommonBll.GetSid();
                    bco.pimg = qcb.CreateQtCode(System.Web.HttpContext.Current.Server.MapPath("/UpFile/OrderQt/"), CommonBll.GetHost() + "UIClient/SalesBusiness/DistributorOrder/SaleOrderDetail.htm?Sid=" + bco.sid);
                    if (bcpob.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 (bcpob.Update(bco))
                    {
                        r = bco.sid;
                    }
                    else
                    {
                        r = "F";
                    }
                    EventBtnDo.FireEventBtn(bco.sid, bcode, "1", " 更改订单");
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }