/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void UpdateButtonClick(object sender, CommandEventArgs e) { Caisis.BOL.Role biz = new Caisis.BOL.Role(); biz.Get(_roleId); biz[Caisis.BOL.Role.Role_Field] = Role.Value; biz[Caisis.BOL.Role.RoleDescription] = RoleDesc.Value; biz[Caisis.BOL.Role.DeactivatedTime] = null; biz.Save(); InsertPermissions(); }
/// <summary> /// Adds a new Role to the database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void AddButtonClick(object sender, CommandEventArgs e) { Caisis.BOL.Role biz = new Caisis.BOL.Role(); biz[Caisis.BOL.Role.Role_Field] = Role.Value; biz[Caisis.BOL.Role.RoleDescription] = RoleDesc.Value; biz.Save(); // After save, verify record inseted and insert permissions string newPriKey = biz[biz.PrimaryKeyName].ToString(); if (!string.IsNullOrEmpty(newPriKey)) { _roleId = int.Parse(newPriKey); InsertPermissions(); } Response.Redirect("AdminRolePermissions.aspx?roleid=" + _roleId); }