Esempio n. 1
0
        public static string InitOverCondition(string ocode, string ccode)
        {
            string r = "";
            Sys_XsOverCondition soc = new Sys_XsOverCondition();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_XsOverCondition csns = cocb.Query(" and ccode='" + ccode + "'");
                if (csns != null)
                {
                    r = js.Serialize(csns);
                }
                else
                {
                    soc.ocode = ocode;
                    soc.oname = snsb.Query(" and ocode='" + ocode + "'").oname;
                    soc.ccode = cocb.CreateCode().ToString().PadLeft(4, '0');
                    soc.id    = 0;
                    r         = js.Serialize(soc);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Esempio n. 2
0
        public static string SaveOverCondition(string tattr, string tbvalue, string tcity, string tcode, string tid, string tjs, string tlcode, string tlname, string tname,
                                               string tprice, string tsz, string ttvalue, string ttype, string txs
                                               )
        {
            string r = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_XsOverCondition s = new Sys_XsOverCondition();
                s.oname      = tlname;
                s.ocode      = tlcode;
                s.cname      = tname;
                s.ccode      = tcode;
                s.bvalue     = Convert.ToInt32(tbvalue);
                s.tvalue     = Convert.ToInt32(ttvalue);;
                s.cattr      = tattr;
                s.cfscale    = Convert.ToDecimal(tsz);
                s.cfstr      = tjs;
                s.cxs        = Convert.ToDecimal(txs);
                s.cpricetype = tprice;
                s.cdate      = DateTime.Now.ToString();
                s.pcity      = tcity;
                s.maker      = iv.u.ename;
                if (tid == "0")
                {
                    if (cocb.Add(s) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    if (cocb.Update(s))
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }