public Task<int> UpdateAsync(IUserRole entity) { try { return Repository.UpdateAsync(entity); } catch (Exception e) { throw new Exception(e.ToString()); } }
public RoleRightsController(IRole role, IUserRole userRole, IModule module, IAction action, IActionModule actionModule, IRoleRight roleRight, ICacheManager cache) { _role = role; _module = module; _actionModule = actionModule; _roleRight = roleRight; _action = action; _cache = cache; _userRole = userRole; }
public virtual Task<int> AddAsync(IUserRole entity) { try { var userRole = Mapper.Map<SchedulerModel.UserRolePOCO>(entity); var dalUserRole = Mapper.Map<SchedulerModel.UserRolePOCO, DALModel.UserRole>(userRole); return Repository.AddAsync<DALModel.UserRole>(dalUserRole); } catch (Exception e) { throw new Exception(e.ToString()); } }
public Task<int> AddUoWAsync(IUserRole entity) { using (TransactionScope scope = new TransactionScope()) { Repository.CreateUnitOfWork(); UnitOfWork = Repository.UnitOfWork; Repository.AddAsync(UnitOfWork, entity); var result = UnitOfWork.CommitAsync(); if (result.Result == 1) { scope.Complete(); } scope.Dispose(); return result; } }
public UserDAL(IOptions <AppSettings> appSettings, UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager, AppDbContext context, SignInManager <ApplicationUser> signInManager, IUserRole userRole) { _appSettings = appSettings.Value; _userManager = userManager; _roleManager = roleManager; _context = context; _signInManager = signInManager; _UserRole = userRole; }
public HostDto(IUserRole userRole) : base(userRole) { }
public virtual bool ValidateUser(IUserRole role) { throw new NotImplementedException(); }
public UserDAL(IOptions <AppSettings> appSettings, UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager, AppDbContext context, SignInManager <ApplicationUser> signInManager, IUserRole userRole, IConfiguration configuration, IEmailSender emailSender) { _appSettings = appSettings.Value; _userManager = userManager; _roleManager = roleManager; _context = context; _signInManager = signInManager; _UserRole = userRole; _configuration = configuration; _emailSender = emailSender; }
public UserRoleController(IUserRole userroleservice, UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager) { _userManager = userManager; _userRoleService = userroleservice; _roleManager = roleManager; }
public UserController(IRole roleStore, IUser userStore, IUserRole userRoleStore) { _roleStore = roleStore; _userStore = userStore; _userRoleStore = userRoleStore; }
public static void MapTo(this IUserRole source, IUserRole target) { target.MapFrom(source); }
public SomeService(Context context, IUserRole userRoleRepository) { _context = context; _userRoleRepository = userRoleRepository; }
public BLUserRole(IUserRole UserRoleobj) { this.UserRoleobj = UserRoleobj; }
public virtual Task<int> DeleteAsync(IUserRole entity) { var userRole = Mapper.Map<IUserRole, SchedulerModel.UserRolePOCO>(entity); var dalUserRole = Mapper.Map<SchedulerModel.UserRolePOCO, DALModel.UserRole>(userRole); return Repository.DeleteAsync<DALModel.UserRole>(dalUserRole); }
public virtual Task<int> AddAsync(IUnitOfWork unitOfWork, IUserRole entity) { var userRole = Mapper.Map<SchedulerModel.UserRolePOCO>(entity); var dalUserRole = Mapper.Map<SchedulerModel.UserRolePOCO, DALModel.UserRole>(userRole); return unitOfWork.AddAsync<DALModel.UserRole>(dalUserRole); }
public static void ClassInit(TestContext context) { container.RegisterType<IUserRepository, UserRepositoryMock>(); UserRoleLogic = container.Resolve<UserRole>(); }
public Task<int> AddAsync(IUserRole entity) { return Repository.AddAsync(entity); }
public virtual bool ValidateUser(IUserRole role) { return(true); }
public Task<int> DeleteAsync(IUserRole entity) { return Repository.DeleteAsync(entity); }
/// <summary> /// Handles the Click event of the btnsave control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void btnsave_Click(object sender, EventArgs e) { if (FieldValidations() == false) { return; } int UserGroupID = 0; int Flag = 0; DataSet theDS = new DataSet(); IUserRole UserRoleManager = (IUserRole)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUserRole, BusinessProcess.Administration"); try { if (Request.QueryString["name"] == "Add") { GroupId = 0; CheckBox chkSelectAll = (CheckBox)grdUserGroupsForm.HeaderRow.Cells[0].FindControl("chkFormAll"); CheckBox chkSelectAllOther = (CheckBox)grdUserGroupsOther.HeaderRow.Cells[0].FindControl("chkOtherAll"); CheckBox chkSelectAllForms = (CheckBox)grdUserGroupAdminForm.HeaderRow.Cells[0].FindControl("chkAllForm"); theDS = UserGroupData(); if (theDS.Tables[0].Rows.Count <= 0 && theDS.Tables[1].Rows.Count <= 0 && theDS.Tables[2].Rows.Count <= 0) { IQCareMsgBox.Show("BlankRow", this); return; } int EnrollmentPrivilage = chkspenroll.Checked == true ? 1 : 0; int CareEndPrivilage = chkCareEndPrivilege.Checked == true ? 1 : 0; int EditIdentifierPrivilage = chkpatientIdentifiers.Checked == true ? 1 : 0; UserGroupID = (int)UserRoleManager.SaveUserGroupDetail(GroupId, txtusergroupname.Text, theDS, Convert.ToInt32(Session["AppUserId"].ToString()), Flag, EnrollmentPrivilage, CareEndPrivilage, EditIdentifierPrivilage); if (UserGroupID == 0) { IQCareMsgBox.Show("UserGroupDetailExists", this); return; } else { IQCareMsgBox.Show("UserGroupDetailSave", this); } } else if (Request.QueryString["name"] == "Edit") { int EnrollmentPrivilage = chkspenroll.Checked == true ? 1 : 0; int CareEndPrivilage = chkCareEndPrivilege.Checked == true ? 1 : 0; int EditIdentifierPrivilage = chkpatientIdentifiers.Checked == true ? 1 : 0; GroupId = Convert.ToInt32(Request.QueryString["GroupID"]); Flag = 1; if (iAllFormCount != 0) { CheckBox chkSelectAll = (CheckBox)grdUserGroupsForm.HeaderRow.Cells[0].FindControl("chkFormAll"); } if (iReportsCount != 0) { CheckBox chkSelectAllOther = (CheckBox)grdUserGroupsOther.HeaderRow.Cells[0].FindControl("chkOtherAll"); } if (iAdminCount != 0) { CheckBox chkSelectAllForms = (CheckBox)grdUserGroupAdminForm.HeaderRow.Cells[0].FindControl("chkAllForm"); } theDS = UserGroupData(); if (theDS.Tables[0].Rows.Count <= 0 && theDS.Tables[1].Rows.Count <= 0 && theDS.Tables[2].Rows.Count <= 0) { IQCareMsgBox.Show("BlankRow", this); return; } UserRoleManager.UpdateUserGroup(GroupId, txtusergroupname.Text, theDS, Convert.ToInt32(Session["AppUserId"].ToString()), Flag, EnrollmentPrivilage, CareEndPrivilage, EditIdentifierPrivilage); IQCareMsgBox.Show("UserGroupDetailUpdate", this); } string theUrl = "frmAdmin_UserGroupList.aspx"; Response.Redirect(theUrl); } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { UserRoleManager = null; } }
public UserService(IUserRole userRole) { _userRole = userRole; }
protected void btnsave_Click(object sender, EventArgs e) { if (FieldValidations() == false) { return; } int UserGroupID = 0; int Flag = 0; int EditCareEnd = 0; int PIdentifiers = 0; DataSet theDS = new DataSet(); IUserRole UserRoleManager = (IUserRole)ObjectFactory.CreateInstance("BusinessProcess.Administration.BUserRole, BusinessProcess.Administration"); try { if (Request.QueryString["name"] == "Add") { GroupId = 0; int EnrollmentPrivilage = 1; theDS = FacilityServiceUserGroupData(out EditCareEnd, out PIdentifiers); int CareEndPrivilage = EditCareEnd; int EditIdentifierPrivilage = PIdentifiers; //if (theDS.Tables[0].Rows.Count <= 0 && CareEndPrivilage == 0 && EditIdentifierPrivilage == 0) //{ // IQCareMsgBox.Show("BlankRow", this); // return; //} UserGroupID = (int)UserRoleManager.SaveUserGroupDetail(GroupId, txtusergroupname.Text, theDS, Convert.ToInt32(Session["AppUserId"].ToString()), Flag, EnrollmentPrivilage, CareEndPrivilage, EditIdentifierPrivilage); if (UserGroupID == 0) { IQCareMsgBox.Show("UserGroupDetailExists", this); return; } else { IQCareMsgBox.Show("UserGroupDetailSave", this); } } else if (Request.QueryString["name"] == "Edit") { int EnrollmentPrivilage = 1; GroupId = Convert.ToInt32(Request.QueryString["GroupID"]); Flag = 1; theDS = FacilityServiceUserGroupData(out EditCareEnd, out PIdentifiers); int CareEndPrivilage = EditCareEnd; int EditIdentifierPrivilage = PIdentifiers; //if (theDS.Tables[0].Rows.Count <= 0 && CareEndPrivilage == 0 && EditIdentifierPrivilage == 0) //{ // IQCareMsgBox.Show("BlankRow", this); // return; //} UserRoleManager.UpdateUserGroup(GroupId, txtusergroupname.Text, theDS, Convert.ToInt32(Session["AppUserId"].ToString()), Flag, EnrollmentPrivilage, CareEndPrivilage, EditIdentifierPrivilage); IQCareMsgBox.Show("UserGroupDetailUpdate", this); } string theUrl = "frmAdmin_UserGroupList.aspx"; Response.Redirect(theUrl); } catch (Exception err) { err.ToString(); MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = "Please check whether parent node is checked"; IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { UserRoleManager = null; } }