Example #1
0
        public static string SetRoleMenu(string rcode, string menulist)
        {
            string              r   = "";
            Sys_MenuBll         smb = new Sys_MenuBll();
            ArrayList           al  = new ArrayList();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                smb.DelRoleMenu(rcode);
                string[] mlarr = menulist.Split(';');
                for (int i = 0; i < mlarr.Length; i++)
                {
                    int arrstr    = mlarr[i].Length;
                    int arrstrlen = arrstr / 2;
                    if (arrstrlen >= 1)
                    {
                        for (int k = 1; k <= arrstrlen; k++)
                        {
                            string leftcode = mlarr[i].Substring(0, k * 2);
                            if (!al.Contains(leftcode))
                            {
                                al.Add(leftcode);
                            }
                        }
                    }
                }
                if (al.Count > 0)
                {
                    DataTable dt = new DataTable();
                    dt.Columns.Add(new DataColumn("mcode", typeof(string)));
                    dt.Columns.Add(new DataColumn("rcode", typeof(string)));
                    for (int i = 0; i < al.Count; i++)
                    {
                        dt.Rows.Add(new object[] { al[i], rcode });
                    }
                    if (smb.SetRoleMenu(dt) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Example #2
0
        public static string ReSetRoleMenu(string rcode)
        {
            string              r   = "";
            Sys_MenuBll         smb = new Sys_MenuBll();
            ArrayList           al  = new ArrayList();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (smb.DelRoleMenu(rcode) > 0)
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }