private void Manp_Users_Shown(object sender, EventArgs e) { User user = new User(); objectBindTool.BindControl(txtLogin, nameof(user.Login)); objectBindTool.BindControl(txtUserName, nameof(user.UserName)); objectBindTool.BindControl(chkIsActive, nameof(user.IsActive)); objectBindTool.BindControl(chkIsAdmin, nameof(user.IsAdmin)); if (Id != 0) { user = OperationHandler.GetUserById(Id).Value; } if (user == null) { OnLoadError(null); } if (user.Id == 0) { } else { txtLogin.ReadOnly = true; } objectBindTool.DataObject = user; }
private void Manp_DataPermissions_Shown(object sender, EventArgs e) { var op_CardMaster = OperationHandler.GetCards(); if (op_CardMaster.Successful) { AllCards = op_CardMaster.Value.Where(x => x.ByPermission).ToList(); searchLookUpCard.Properties.DataSource = AllCards; } User user = OperationHandler.GetUserById(UserId).Value; txtUserName.Text = user.UserName; refreshLines(); }