Exemplo n.º 1
0
        public static void LoadFunctionUsers()
        {
            try
            {
                FunctionsController _FunctionsController = new FunctionsController();
                ArrayList           _arr = _FunctionsController.Function_GetAll();
                c_hashFunctionList.Clear();
                foreach (FunctionsInfo _FuncInfo in _arr)
                {
                    if (_FuncInfo.objname != null && _FuncInfo.objname != "")
                    {
                        c_hashFunctionList[_FuncInfo.objname] = _FuncInfo;
                    }
                }

                User_Controller _UserControler = new User_Controller();
                c_arrQuyen = _UserControler.Send_Users_Get_MenuItem(CommonData.c_Urser_Info.User_Name);
                c_hash_Quyen.Clear();
                foreach (User_FunctionsInfo item in c_arrQuyen)
                {
                    if (item.name != null)
                    {
                        c_hash_Quyen[item.name] = item;
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }
Exemplo n.º 2
0
        private void loaddata()
        {
            try
            {
                c_arrUserRight        = c_FunctionsController.Function_GetAll();
                c_hs_Function_OfGroup = _Function_GroupController.Get_Function_ByGroup(c_GroupUserInfo.Id);

                foreach (FunctionsInfo item in c_arrUserRight)
                {
                    if (c_hs_Function_OfGroup.ContainsKey(item.id))
                    {
                        item.ofgroup = 1;
                    }
                    else
                    {
                        item.ofgroup = 0;
                    }
                }


                foreach (FunctionsInfo item in c_arrUserRight)
                {
                    if (item.last == "Y") // Y là con
                    {
                        Brush brush = (Brush)bc.ConvertFromString("#003D76");
                        brush.Freeze();
                        item.Br_N = brush;
                    }
                    else // n là cha
                    {
                        item.Br_N = Brushes.Red;
                    }

                    if (item.ofgroup == 1)
                    {
                        c_hs_UserRight_First[item.id] = item;
                    }
                }

                dgFunctions.ItemsSource = c_arrUserRight;
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }