Esempio n. 1
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);
        }
Esempio n. 2
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);
        }