Example #1
0
        public static string InitOverCondition(string ocode, string ccode)
        {
            string              r   = "";
            Sys_CgOverCondtion  soc = new Sys_CgOverCondtion();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_CgOverCondtion 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);
        }
Example #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_CgOverCondtion s = new Sys_CgOverCondtion();
                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);
        }