Beispiel #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);
        }