示例#1
0
        public static string InitLButton(string emcode, string bcode)
        {
            string              r    = "";
            Sys_EventMenuBll    semb = new Sys_EventMenuBll();
            Sys_EventMenu       sem  = new Sys_EventMenu();
            Sys_ButtonBll       sbb  = new Sys_ButtonBll();
            Sys_Button          sb   = new Sys_Button();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (bcode == "" || bcode == null)
                {
                    sem       = semb.Query(" and emcode='" + emcode + "'");
                    sb.id     = 0;
                    sb.bname  = "";
                    sb.bcode  = sbb.CreateCode().ToString().PadLeft(4, '0');
                    sb.emname = sem.emname == null ? "" : sem.emname;
                    sb.emcode = sem.emcode == null ? "" : sem.emcode;
                    sb.bshow  = true;
                }
                else
                {
                    sb = sbb.Query(" and bcode='" + bcode + "'");
                }
                r = js.Serialize(sb);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
示例#2
0
        public static string InitWButton(string wcode, string bcode)
        {
            string              r    = "";
            Sys_WorkEventBll    sweb = new Sys_WorkEventBll();
            Sys_WorkEvent       swe  = new Sys_WorkEvent();
            Sys_ButtonBll       sbb  = new Sys_ButtonBll();
            Sys_Button          sb   = new Sys_Button();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (bcode == "" || bcode == null)
                {
                    swe      = sweb.Query(" and wcode='" + wcode + "'");
                    sb.id    = 0;
                    sb.bname = "";
                    sb.bcode = sbb.CreateCode().ToString().PadLeft(4, '0');
                    sb.wname = swe.wname == null ? "" : swe.wname;
                    sb.wcode = swe.wcode == null ? "" : swe.wcode;
                }
                else
                {
                    sb = sbb.Query(" and bcode='" + bcode + "'");
                }
                r = js.Serialize(sb);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }