Beispiel #1
0
        public static string SavePackage(string bcode, string bid, string bjs, string bname, string bzsx, string cptype, string gsj, string gxj, string ksj, string kxj, string sftz, string tjs, string zdjs, string zjlx)
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Package s = new Sys_Package();
                s.pname   = bname;
                s.pcode   = bcode;
                s.basenum = Convert.ToInt32(bjs);
                s.zjtype  = zjlx;
                s.istz    = sftz;
                s.tznum   = Convert.ToInt32(tjs);
                s.psort   = bzsx;
                s.maxnum  = Convert.ToInt32(zdjs);
                s.hlvalue = Convert.ToInt32(gxj);
                s.htvalue = Convert.ToInt32(gsj);
                s.klvalue = Convert.ToInt32(kxj);
                s.ktvalue = Convert.ToInt32(ksj);
                s.cdate   = DateTime.Now.ToString();
                s.cptype  = cptype;
                s.maker   = iv.u.ename;
                if (iv.u.rcode != "xtgl")
                {
                    s.dcode = iv.u.dcode.Substring(0, 8);
                }
                else
                {
                    s.dcode = "";
                }
                if (bid == "0")
                {
                    if (spb.Add(s) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (spb.Update(s))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Beispiel #2
0
        public static string InitPackage(string pcode)
        {
            string              r  = "";
            Sys_Package         so = new Sys_Package();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Package sob = spb.Query(" and pcode='" + pcode + "'");
                if (sob != null)
                {
                    r = js.Serialize(sob);
                }
                else
                {
                    so.pname = "";
                    so.pcode = spb.CreateCode().ToString().PadLeft(4, '0');
                    so.id    = 0;
                    r        = js.Serialize(so);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }