Ejemplo n.º 1
0
 /// <summary>
 /// check trùng Group name
 /// </summary>
 private bool CheckNameNotSame(string name)
 {
     try
     {
         bool _ck = true;
         List <GroupUserInfo> _arr = moncon.GroupUser_GetAll();
         if (_arr.Count > 0 && _arr != null)
         {
             foreach (GroupUserInfo item in _arr)
             {
                 if (item.Name.ToUpper() == name.ToUpper())
                 {
                     _ck = false;
                     break;
                 }
             }
         }
         return(_ck);;
     }
     catch (Exception ex)
     {
         CommonData.log.Error(ex.ToString());
         return(false);
     }
 }
Ejemplo n.º 2
0
        void LoadData()
        {
            try
            {
                GroupUserController  _GroupUserController = new GroupUserController();
                List <GroupUserInfo> _lst = _GroupUserController.GroupUser_GetAll();

                cbo_Group_User.SelectedValuePath = "Id";
                cbo_Group_User.DisplayMemberPath = "Name";
                cbo_Group_User.ItemsSource       = _lst;
                cbo_Group_User.SelectedIndex     = 0;

                if (c_type == Convert.ToInt16(Form_Type.Insert))
                {
                    txtFullName.Focus();
                }
                else if (c_type == Convert.ToInt16(Form_Type.Update))
                {
                    this.Title = "Cập nhật thông tin người dùng [" + c_User_Info.User_Name + "]";

                    txtFullName.Text             = c_User_Info.FullName;
                    txtUserName.Text             = c_User_Info.User_Name;
                    txtPass.Text                 = c_User_Info.Pass;
                    txtPhone.Text                = c_User_Info.Phone;
                    cbo_Group_User.SelectedValue = c_User_Info.Group_Id;

                    txtUserName.IsEnabled = false;
                    txtPass.IsEnabled     = false;
                    txtFullName.Focus();
                }
                else if (c_type == Convert.ToInt16(Form_Type.View))
                {
                    this.Title = "Thông tin người dùng [" + c_User_Info.User_Name + "]";

                    txtFullName.Text             = c_User_Info.FullName;
                    txtUserName.Text             = c_User_Info.User_Name;
                    txtPass.Text                 = c_User_Info.Pass;
                    txtPhone.Text                = c_User_Info.Phone;
                    cbo_Group_User.SelectedValue = c_User_Info.Group_Id;

                    txtFullName.IsEnabled           = false;
                    txtUserName.IsEnabled           = false;
                    txtPhone.IsEnabled              = false;
                    txtPass.IsEnabled               = false;
                    cbo_Group_User.IsHitTestVisible = false;
                    cbo_Group_User.Focusable        = false;
                }
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// hiện thị dữ liệu lên datagrid
        /// </summary>
        private void LoadData()
        {
            try
            {
                arrAllGroupUser = _grUsCon.GroupUser_GetAll();
                if (arrAllGroupUser != null && arrAllGroupUser.Count >= 0)
                {
                    dgrGroupUser.ItemsSource = arrAllGroupUser;
                }

                //txtTotal.Text = arrFunctions_By_System.Count.ToString();
                //txtTotal.IsReadOnly = true;
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }