コード例 #1
0
        public JsonResult InitCondition(string dcode, string tjcode)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_SaleDiscountCondition sa = new Sys_SaleDiscountCondition();
                if (tjcode != "")
                {
                    sa = ssdcb.Query(" and  tjcode='" + tjcode + "'");
                }
                else
                {
                    Sys_SaleDiscount ssd = ssdb.Query(" and dcode='" + dcode + "'");
                    if (ssd != null)
                    {
                        sa.dname = ssd.dname;
                        sa.dcode = ssd.dcode;
                    }
                    sa.id     = 0;
                    sa.tjcode = ssdcb.CreateCode().ToString().PadLeft(4, '0');
                }
                d.d = js.Serialize(sa);
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }
コード例 #2
0
        public JsonResult SaveCondition(string hdcode, string hdname, string tjcode, string tjfw, string tjid, string tjlb, string tjlv, string tjname, string tjmethod, string tjsort, string tjtv, string zkje, string zzk)
        {
            JsonData            d  = new JsonData();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_SaleDiscountCondition sa = new Sys_SaleDiscountCondition();
                sa.dname    = hdname;
                sa.dcode    = hdcode;
                sa.tjname   = tjname;
                sa.tjcode   = tjcode;
                sa.dlv      = Convert.ToDecimal(tjlv);
                sa.dtv      = Convert.ToDecimal(tjtv);
                sa.dsort    = Convert.ToInt32(tjsort);
                sa.dzk      = Convert.ToDecimal(zzk);
                sa.dvalue   = Convert.ToDecimal(zkje);
                sa.tjmethod = tjmethod;
                sa.tjfw     = tjfw;
                sa.tjlb     = tjlb;
                sa.maker    = iv.u.ename;
                sa.cdate    = DateTime.Now.ToString();
                if (tjid == "0")
                {
                    if (ssdcb.Add(sa) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (ssdcb.Update(sa))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }