Esempio n. 1
0
        public static string InitNomalSize(string ncode)
        {
            string              r    = "";
            Sys_NomalSize       sns  = new Sys_NomalSize();
            Sys_NomalSizeBll    snsb = new Sys_NomalSizeBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_NomalSize csns = snsb.Query(" and ncode='" + ncode + "'");
                if (csns != null)
                {
                    r = js.Serialize(csns);
                }
                else
                {
                    sns.nname = "";
                    sns.ncode = snsb.CreateCode().ToString().PadLeft(4, '0');
                    sns.id    = 0;
                    r         = js.Serialize(sns);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Esempio n. 2
0
        public static string RefNSize(string icode)
        {
            string              r    = "";
            BusiInvSizeBll      snsb = new BusiInvSizeBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_NomalSize sns = snsb.RefInvSize(icode);
                if (sns != null)
                {
                    r = js.Serialize(sns);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Esempio n. 3
0
        public static string SaveNomalSize(string bcd, string bcode, string bfc, string bhd, string bid, string bkd, string bname, string bsl, string btype, string rhd, string rgd, string rkd, string rsl, string rtype)
        {
            string              r    = "";
            Sys_NomalSizeBll    snsb = new Sys_NomalSizeBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_NomalSize s = new Sys_NomalSize();
                s.nname = bname;
                s.ncode = bcode;
                s.ng    = Convert.ToInt32(bcd = bcd == "" ? "0" : bcd);
                s.nk    = Convert.ToInt32(bkd = bkd == "" ? "0" : bkd);
                s.nh    = Convert.ToInt32(bhd = bhd == "" ? "0" : bhd);
                s.nsl   = Convert.ToInt32(bsl = bsl == "" ? "0" : bsl);
                s.nf    = Convert.ToInt32(bfc = bfc == "" ? "0" : bfc);
                s.nattr = btype;
                if (rtype == "1")
                {
                    s.nrelate = true;
                }
                else
                {
                    s.nrelate = false;
                }
                s.nrg   = Convert.ToInt32(rgd);
                s.nrk   = Convert.ToInt32(rkd);
                s.nrn   = Convert.ToInt32(rhd);
                s.nrsl  = Convert.ToInt32(rsl);
                s.cdate = DateTime.Now.ToString();
                s.maker = iv.u.ename;
                if (iv.u.rcode == "xtgl")
                {
                    s.dcode = "";
                }
                else
                {
                    s.dcode = iv.u.dcode.Substring(0, 8);
                }
                if (bid == "0")
                {
                    if (snsb.Add(s) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (snsb.Update(s))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }