예제 #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 static string CustSaveComputeMethod(string ptcode, string ptid, string ptlx, string ptname, string ptms)
        {
            string              r   = "";
            Sys_PriceTypeBll    srb = new Sys_PriceTypeBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_PriceType sr = new Sys_PriceType();
                sr.ptname = ptname;
                sr.ptcode = ptcode;
                sr.ptype  = ptlx;
                sr.pms    = ptms;
                sr.cdate  = DateTime.Now.ToString();
                sr.maker  = iv.u.ename;
                sr.dcode  = iv.u.dcode.Substring(0, 8);
                if (ptid == "0")
                {
                    if (!srb.Exists(" and ptname='" + ptname + "'"))
                    {
                        if (srb.Add(sr) > 0)
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                    else
                    {
                        r = "T";
                    }
                }
                else
                {
                    if (!srb.Exists(" and ptname='" + ptname + "' and ptcode<>'" + ptcode + "'"))
                    {
                        if (srb.Update(sr))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                    else
                    {
                        r = "T";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
예제 #3
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));
        }
예제 #4
0
        public static string SavePriceType(string lcode, string lid, string lms, string lname, string ltype)
        {
            string              r   = "";
            Sys_PriceTypeBll    srb = new Sys_PriceTypeBll();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_PriceType sr = new Sys_PriceType();
                if (iv.u.rcode == "xtgl")
                {
                    sr.dcode = "";
                }
                else
                {
                    sr.dcode = iv.u.dcode.Substring(0, 8);
                }
                sr.ptname = lname;
                sr.ptcode = lcode;
                sr.ptype  = ltype;
                sr.pms    = lms;
                sr.cdate  = DateTime.Now.ToString();
                sr.maker  = iv.u.ename;
                if (lid == "0")
                {
                    if (!srb.Exists(" and ptname='" + lname + "'"))
                    {
                        if (srb.Add(sr) > 0)
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                    else
                    {
                        r = "T";
                    }
                }
                else
                {
                    if (!srb.Exists(" and ptname='" + lname + "' and ptcode<>'" + lcode + "'"))
                    {
                        if (srb.Update(sr))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                    else
                    {
                        r = "T";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }