コード例 #1
0
        public static string InitPriceType(string ptcode)
        {
            string              r   = "";
            Sys_PriceType       sr  = new Sys_PriceType();
            Sys_PriceTypeBll    srb = new Sys_PriceTypeBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_PriceType csr = srb.Query(" and ptcode='" + ptcode + "'");
                if (csr != null)
                {
                    r = js.Serialize(csr);
                }
                else
                {
                    sr.ptname = "";
                    sr.ptcode = srb.CreateCode().ToString().PadLeft(4, '0');
                    sr.id     = 0;
                    r         = js.Serialize(sr);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
コード例 #2
0
        public JsonResult SaveSectionCate(string qlid, string qccode, string qcname, string qtx)
        {
            JsonData             d  = new JsonData();
            Sys_SectionPriceCate sb = new Sys_SectionPriceCate();
            SessionUserValidate  iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                sb.sname = qcname;
                sb.scode = qccode;
                sb.pcode = qtx;
                Sys_PriceType spt = sptb.Query(" and ptcode='" + qtx + "'");
                if (spt != null)
                {
                    sb.pname = spt.ptname;
                }
                if (iv.u.rcode == "xtgl")
                {
                    sb.dcode = "";
                }
                else
                {
                    sb.dcode = iv.u.dcode.Substring(0, 8);
                }
                sb.maker = iv.u.ename;
                sb.cdate = DateTime.Now.ToString();
                if (qlid == "0")
                {
                    if (sspcb.Add(sb) > 0)
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
                else
                {
                    if (sspcb.Update(sb))
                    {
                        d.d = "S";
                    }
                    else
                    {
                        d.d = "F";
                    }
                }
            }
            else
            {
                d.d = iv.badstr;
            }
            return(Json(d));
        }