protected void Page_Load(object sender, EventArgs e) { String mGroupSeqId = GWWebHelper.GetQueryValue(Request, "GroupSeqID"); if (!String.IsNullOrEmpty(mGroupSeqId)) { int mGroupID = int.Parse(mGroupSeqId); if (mGroupID != -1) { m_Profile = GroupUtility.GetProfile(mGroupID); } else { m_Profile = new MGroupProfile(); } HttpContext.Current.Session.Add("EditId", m_Profile.Id); populatePage(); } }
public IHttpActionResult Delete([FromUri] int groupSeqId) { string mRetVal = "false"; MSecurityInfo mSecurityInfo = new MSecurityInfo(FunctionUtility.GetProfile(ConfigSettings.GetAppSettingValue("Actions_EditGroups", true)), AccountUtility.CurrentProfile()); if (!mSecurityInfo.MayDelete) { Exception mError = new Exception("The account (" + AccountUtility.CurrentProfile().Account + ") being used does not have the correct permissions to delete"); Logger mLog = Logger.Instance(); mLog.Error(mError); return(this.InternalServerError(mError)); } else { if (HttpContext.Current.Items["EditId"] != null) { int mEditId = int.Parse(HttpContext.Current.Items["EditId"].ToString()); if (mEditId == groupSeqId) { MGroupProfile mProfile = GroupUtility.GetProfile(groupSeqId); GroupUtility.Delete(mProfile); } else { Exception mError = new Exception("Identifier you have last looked at does not match the one passed in nothing has been saved!!!!"); Logger mLog = Logger.Instance(); mLog.Error(mError); return(this.InternalServerError(mError)); } } else { Exception mError = new Exception("The identifier unknown and nothing has been saved!!!!"); Logger mLog = Logger.Instance(); mLog.Error(mError); return(this.InternalServerError(mError)); } } return(Ok(mRetVal)); }
protected void Page_Load(object sender, EventArgs e) { MAccountProfile updatingAccount = null; MGroupProfile mGroupProfile = GroupUtility.GetProfile(int.Parse(HttpContext.Current.Request["GroupSeqId"])); txtEditID.Text = mGroupProfile.Id.ToString(); litGroup.Text = mGroupProfile.Name; HttpContext.Current.Session.Add("EditId", mGroupProfile.Id); updatingAccount = AccountUtility.CurrentProfile(); DataView myDataView = RoleUtility.GetAllRolesBySecurityEntity(int.Parse(ClientChoicesState[MClientChoices.SecurityEntityId].ToString())).DefaultView; if (!updatingAccount.IsSystemAdmin) { String rowFilter = "IS_SYSTEM <> 1 AND IS_SYSTEM_ONLY <> 1"; myDataView.RowFilter = rowFilter; } try { MGroupProfile myGroupProfile = new MGroupProfile(); myGroupProfile = GroupUtility.GetProfile(int.Parse(txtEditID.Text.ToString())); litGroup.Text = myGroupProfile.Name; MGroupRoles mProfile = new MGroupRoles(); mProfile.SecurityEntityId = int.Parse(ClientChoicesState[MClientChoices.SecurityEntityId].ToString()); mProfile.GroupSeqId = int.Parse(txtEditID.Text.ToString()); ctlMembers.SelectedItems = GroupUtility.GetSelectedRoles(mProfile); } catch (Exception ex) { Logger log = Logger.Instance(); log.Debug(ex); } ctlMembers.DataSource = myDataView; ctlMembers.DataField = "Name"; ctlMembers.DataBind(); }