Exemplo n.º 1
0
        public static string InitOverCondition(string ocode, string ccode)
        {
            string r = "";
            Sys_OverComputeCategoryBll snsb = new Sys_OverComputeCategoryBll();
            Sys_OverConditionBll       cocb = new Sys_OverConditionBll();
            Sys_OverCondition          soc  = new Sys_OverCondition();
            SessionUserValidate        iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_OverCondition 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);
        }
Exemplo 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 = "";
            Sys_OverConditionBll snsb = new Sys_OverConditionBll();
            SessionUserValidate  iv   = SysValidateBll.ValidateSession();

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