protected void Page_Load(object sender, EventArgs e) { MDBInformation mProfile = DBInformationUtility.DBInformation(); lblVersion.Text = mProfile.Version; NameValuePairUtility.SetDropSelection(dropEnableInheritance, mProfile.EnableInheritance.ToString()); }
protected void Page_Load(object sender, EventArgs e) { string rowFilter = "FUNCTION_TYPE_SEQ_ID <> 2 AND FUNCTION_TYPE_SEQ_ID <> 3"; DataView myDataView = AccountUtility.GetMenu(AccountUtility.CurrentProfile().Account, MenuType.Hierarchical).DefaultView; myDataView.Sort = "Title asc"; myDataView.RowFilter = rowFilter; dropFavorite.DataSource = myDataView; dropFavorite.DataValueField = "url"; dropFavorite.DataTextField = "Title"; dropFavorite.DataBind(); txtPreferedRecordsPerPage.Text = ClientChoicesState[MClientChoices.RecordsPerPage].ToString(); NameValuePairUtility.SetDropSelection(dropFavorite, ClientChoicesState[MClientChoices.Action].ToString()); int X = 0; for (X = 1; X <= 5; X++) { HtmlInputRadioButton button = (HtmlInputRadioButton)this.FindControl("Radio" + X); if (button.Value.Substring(0, ClientChoicesState[MClientChoices.ColorScheme].Length).ToLower(new CultureInfo("en-US", false)) == ClientChoicesState[MClientChoices.ColorScheme].ToLower(new CultureInfo("en-US", false))) { button.Checked = true; break; // TODO: might not be correct. Was : Exit For } } }
private void populateFunctionTypes() { dropFunctionType.DataSource = FunctionTypeUtility.FunctionTypes(); dropFunctionType.DataTextField = "NAME"; dropFunctionType.DataValueField = "FUNCTION_TYPE_SEQ_ID"; dropFunctionType.DataBind(); if (m_Profile.Id != -1) { NameValuePairUtility.SetDropSelection(dropFunctionType, m_Profile.FunctionTypeSeqId.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { MAccountProfile mAccountProfile = AccountUtility.CurrentProfile(); int mSecurityId = int.Parse(ClientChoicesState[MClientChoices.SecurityEntityId]); dropSecurityEntities.DataSource = SecurityEntityUtility.GetValidSecurityEntities(mAccountProfile.Account, mSecurityId, mAccountProfile.IsSystemAdmin); dropSecurityEntities.DataValueField = "SE_SEQ_ID"; dropSecurityEntities.DataTextField = "NAME"; dropSecurityEntities.DataBind(); NameValuePairUtility.SetDropSelection(dropSecurityEntities, mSecurityId.ToString()); }
private void populateLinkBehaviors() { DataTable mDataTable = new DataTable(); int mNavType = GWWebHelper.LinkBehaviorNameValuePairSequenceId; NameValuePairUtility.GetNameValuePairDetails(ref mDataTable, mNavType); dropLinkBehavior.DataSource = mDataTable; dropLinkBehavior.DataTextField = "NVP_DET_TEXT"; dropLinkBehavior.DataValueField = "NVP_SEQ_DET_ID"; dropLinkBehavior.DataBind(); if (m_Profile.Id != -1) { NameValuePairUtility.SetDropSelection(dropLinkBehavior, m_Profile.LinkBehavior.ToString()); } }
private void populateParent() { //dvFunctions.RowFilter = "PARENT_FUNCTION_SEQ_ID <> " + CurrentProfile.ID; var mResult = from mProfile in FunctionUtility.Functions() where mProfile.ParentId != m_Profile.Id select mProfile; dropNavParent.DataValueField = "Id"; dropNavParent.DataTextField = "Name"; dropNavParent.DataSource = mResult; dropNavParent.DataBind(); if (m_Profile.Id != -1) { NameValuePairUtility.SetDropSelection(dropNavParent, m_Profile.ParentId.ToString()); } }
private void bindData(MSearchCriteria searchCriteria) { DataTable mDataTable = NameValuePairUtility.Search(searchCriteria); if (mDataTable != null && mDataTable.Rows.Count > 0) { DataView mDataView = mDataTable.DefaultView; recordsReturned.Value = mDataTable.Rows[0][0].ToString(); searchResults.DataSource = mDataTable; searchResults.DataBind(); } else { noResults.Visible = true; } }
private void populateGeneral() { txtAccount_seq_id.Value = m_Profile.Id.ToString(); txtAccount_seq_id.Style.Add("display", "none"); txtAccount.Text = m_Profile.Account; chkSysAdmin.Checked = m_Profile.IsSystemAdmin; litFailedAttempts.Text = m_Profile.FailedAttempts.ToString(); txtFailedAttempts.Text = m_Profile.FailedAttempts.ToString(); txtFirstName.Text = m_Profile.FirstName; txtLastName.Text = m_Profile.LastName; txtMiddleName.Text = m_Profile.MiddleName; txtPreferredName.Text = m_Profile.PreferredName; txtEmail.Text = m_Profile.Email; txtLocation.Text = m_Profile.Location; chkEnableNotifications.Checked = m_Profile.EnableNotifications; NameValuePairUtility.SetDropSelection(dropStatus, m_Profile.Status.ToString()); NameValuePairUtility.SetDropSelection(dropTimezone, m_Profile.TimeZone.ToString()); }
private void populateFucntionDrop() { if (m_Profile.Id > 0) { DataView mDataView = FunctionUtility.GetFunctionMenuOrder(m_Profile).DefaultView; if (mDataView.Count > 0) { mDataView.Sort = "[Name] ASC"; dropFunctions.DataSource = mDataView; dropFunctions.DataValueField = "FUNCTION_SEQ_ID"; dropFunctions.DataTextField = "NAME"; dropFunctions.DataBind(); if (m_Profile.Id != -1) { NameValuePairUtility.SetDropSelection(dropFunctions, m_Profile.Id.ToString()); } } } }
public IHttpActionResult DeleteNameValuePairDetail(UINVPDetailProfile uiProfile) { string mRetVal = false.ToString(); String mAction = GWWebHelper.GetQueryValue(HttpContext.Current.Request, "Action"); int mEditId = int.Parse(HttpContext.Current.Items["EditId"].ToString()); MAccountProfile mUpdatingAccount = AccountUtility.CurrentProfile(); MSecurityInfo mSecurityInfo = new MSecurityInfo(FunctionUtility.GetProfile(mAction), mUpdatingAccount); Logger mLog = Logger.Instance(); if (mEditId != uiProfile.NVP_SEQ_DET_ID) { Exception mError = new Exception("Identifier you have last looked at does not match the one passed in nothing has been saved!!!!"); mLog.Error(mError); return(this.InternalServerError(mError)); } if (!mSecurityInfo.MayDelete) { Exception mError = new Exception("The account (" + mUpdatingAccount.Account + ") being used does not have the correct permissions to delete"); mLog.Error(mError); return(this.InternalServerError(mError)); } try { MNameValuePairDetail mProfile = new MNameValuePairDetail(); mProfile.NameValuePairSeqId = uiProfile.NVP_SEQ_ID; mProfile.Id = uiProfile.NVP_SEQ_DET_ID; mProfile.UpdatedBy = mUpdatingAccount.Id; mProfile.UpdatedDate = DateTime.Now; mProfile.SortOrder = uiProfile.SortOrder; mProfile.Text = uiProfile.Text; mProfile.Value = uiProfile.Value; mProfile.Status = uiProfile.Status; NameValuePairUtility.DeleteDetail(mProfile); } catch (Exception ex) { mLog.Error(ex); throw; } return(this.Ok(mRetVal)); }
private void bindData(MSearchCriteria searchCriteria) { int mNVP_SeqID = int.Parse(searchCriteria.WhereClause.Replace("NVP_SEQ_ID = ", "")); searchCriteria.OrderByColumn = "Table_Name"; DataTable mDataTable = NameValuePairUtility.GetNameValuePairDetails(mNVP_SeqID); DataHelper.GetPageOfData(ref mDataTable, searchCriteria); if (mDataTable != null && mDataTable.Rows.Count > 0) { DataView mDataView = mDataTable.DefaultView; recordsReturned.Value = mDataTable.Rows[0][0].ToString(); searchResults.DataSource = mDataTable; searchResults.DataBind(); } else { noResults.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["NVP_SEQ_ID"])) { int mNameValuePairSeqID = int.Parse((HttpContext.Current.Request.QueryString["NVP_SEQ_ID"]).ToString()); if (mNameValuePairSeqID != -1) { m_NVPToUpdate = NameValuePairUtility.GetNameValuePair(mNameValuePairSeqID); } else { m_NVPToUpdate = new MNameValuePair(); } HttpContext.Current.Session.Add("EditId", m_NVPToUpdate.Id); } else { tdStatus.Style.Add("display", "none"); dropStatus.Style.Add("display", "none"); } populatePage(m_NVPToUpdate); }
private void populateRolesAndGroups(MNameValuePair profile) { int mSecurityEntityId = int.Parse(ClientChoicesState[MClientChoices.SecurityEntityId].ToString()); DataView mDVRoles = RoleUtility.GetAllRolesBySecurityEntity(mSecurityEntityId).DefaultView; DataView mDVGroups = GroupUtility.GetAllGroupsBySecurityEntity(mSecurityEntityId).DefaultView; try { ctlGroups.SelectedItems = NameValuePairUtility.GetSelectedGroups(m_NVPToUpdate.Id); ctlRoles.SelectedItems = NameValuePairUtility.GetSelectedRoles(m_NVPToUpdate.Id); } catch (Exception ex) { Logger mLog = Logger.Instance(); mLog.Debug(ex); } ctlGroups.DataSource = mDVGroups; ctlGroups.DataField = "Name"; ctlGroups.DataBind(); ctlRoles.DataSource = mDVRoles; ctlRoles.DataField = "Name"; ctlRoles.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string NVP_SEQ_ID = GWWebHelper.GetQueryValue(Request, "NVP_SEQ_ID"); string NVP_Detail_SeqID = GWWebHelper.GetQueryValue(Request, "NVP_Detail_SeqID"); MNameValuePairDetail mProfile = new MNameValuePairDetail(); if (!String.IsNullOrEmpty(NVP_SEQ_ID) && !String.IsNullOrEmpty(NVP_Detail_SeqID)) { int mSeqId = int.Parse(NVP_SEQ_ID); int mSeqDetId = int.Parse(NVP_Detail_SeqID); if (mSeqDetId != -1) { mProfile = NameValuePairUtility.GetNameValuePairDetail(mSeqDetId, mSeqId); } hdnNVP_SEQ_ID.Value = mSeqId.ToString(); hdnNVP_SEQ_DET_ID.Value = mProfile.Id.ToString(); txtValue.Value = mProfile.Value; txtText.Value = mProfile.Text; txtSortOrder.Value = mProfile.SortOrder.ToString(); HttpContext.Current.Session.Add("EditId", mProfile.Id); } HttpContext.Current.Session.Add("EditId", mProfile.Id); }
private void populatePage() { litSecurityEntity.Text = m_Profile.Name; txtSecurityEntity.Text = m_Profile.Name; if (m_Profile.Id == -1) { litSecurityEntity.Visible = false; txtSecurityEntity.Style.Add("display", ""); } else { litSecurityEntity.Visible = true; txtSecurityEntity.Style.Add("display", "none"); } txtSeqID.Text = m_Profile.Id.ToString(); txtDescription.Text = m_Profile.Description; txtURL.Text = m_Profile.Url; try { txtConnectionstring.Text = CryptoUtility.Decrypt(m_Profile.ConnectionString, SecurityEntityUtility.CurrentProfile().EncryptionType); } catch (Exception) { txtConnectionstring.Text = m_Profile.ConnectionString; } litSecurityEntityTranslation.Text = ConfigSettings.SecurityEntityTranslation; txtAssembly_Name.Text = m_Profile.DataAccessLayerAssemblyName; txtName_Space.Text = m_Profile.DataAccessLayerNamespace; MDirectoryProfile myDirectoryInfo = new MDirectoryProfile(); DataView dvSkin = new DataView(); dvSkin = FileUtility.GetDirectoryTableData(GWWebHelper.SkinPath, myDirectoryInfo, false).DefaultView; dvSkin.RowFilter = "Type = 'folder'"; dropSkin.DataSource = dvSkin; dropSkin.DataTextField = "Name"; dropSkin.DataValueField = "Name"; dropSkin.DataBind(); DataView dvStyles = new DataView(); dvStyles = FileUtility.GetDirectoryTableData(Server.MapPath(@"~\Content\FormStyles"), myDirectoryInfo, true).DefaultView; dvStyles.RowFilter = "[Name] like '%.css'"; dropStyles.DataSource = dvStyles; dropStyles.DataTextField = "ShortFileName"; dropStyles.DataValueField = "ShortFileName"; dropStyles.DataBind(); Collection <MSecurityEntityProfile> mProfiles = SecurityEntityUtility.Profiles(); dropParent.DataSource = mProfiles; MSecurityEntityProfile mm = new MSecurityEntityProfile(); dropParent.DataTextField = "Name"; dropParent.DataValueField = "Id"; dropParent.DataBind(); ListItem lstItem = new ListItem(); lstItem.Text = "None"; lstItem.Value = "-1"; dropParent.Items.Add(lstItem); NameValuePairUtility.SetDropSelection(dropParent, m_Profile.ParentSeqId.ToString()); NameValuePairUtility.SetDropSelection(dropSkin, m_Profile.Skin); NameValuePairUtility.SetDropSelection(dropStyles, m_Profile.Style); NameValuePairUtility.SetDropSelection(dropStatus, m_Profile.StatusSeqId.ToString()); NameValuePairUtility.SetDropSelection(dropDAL, m_Profile.DataAccessLayer); NameValuePairUtility.SetDropSelection(dropEncryptionType, m_Profile.EncryptionType.ToString()); }
public IHttpActionResult SaveNameValuePair(UINVPProfile uiProfile) { string mRetVal = false.ToString(); MNameValuePair mProfile = new MNameValuePair(); String mAction = GWWebHelper.GetQueryValue(HttpContext.Current.Request, "Action"); int mEditId = int.Parse(HttpContext.Current.Items["EditId"].ToString()); Logger mLog = Logger.Instance(); if (mEditId != uiProfile.NVP_SEQ_ID) { Exception mError = new Exception("Identifier you have last looked at does not match the one passed in nothing has been saved!!!!"); mLog.Error(mError); return(this.InternalServerError(mError)); } MAccountProfile mUpdatingAccount = AccountUtility.CurrentProfile(); MSecurityEntityProfile mSecurityEntityProfile = SecurityEntityUtility.CurrentProfile(); MSecurityInfo mSecurityInfo = new MSecurityInfo(FunctionUtility.GetProfile(mAction), mUpdatingAccount); String mGroups = String.Join(",", uiProfile.Groups); String mRoles = String.Join(",", uiProfile.Roles); String mCommaSepRoles = mUpdatingAccount.GetCommaSeparatedAssignedRoles; if (uiProfile.NVP_SEQ_ID != -1) { if (!mSecurityInfo.MayAdd) { Exception mError = new Exception("The account (" + mUpdatingAccount.Account + ") being used does not have the correct permissions to add"); mLog.Error(mError); return(this.InternalServerError(mError)); } } else { if (!mSecurityInfo.MayAdd) { Exception mError = new Exception("The account (" + mUpdatingAccount.Account + ") being used does not have the correct permissions to edit"); mLog.Error(mError); return(this.InternalServerError(mError)); } } if (uiProfile.NVP_SEQ_ID != -1) { mProfile = NameValuePairUtility.GetNameValuePair(uiProfile.NVP_SEQ_ID); } else { mProfile.AddedBy = mUpdatingAccount.Id; mProfile.AddedDate = DateTime.Today; } mProfile.UpdatedBy = mUpdatingAccount.Id; mProfile.UpdatedDate = DateTime.Today; mProfile.StaticName = uiProfile.STATIC_NAME; mProfile.SchemaName = uiProfile.SchemaName; mProfile.Display = uiProfile.Display; mProfile.Description = uiProfile.Description; mProfile.Status = uiProfile.Status; int mID = NameValuePairUtility.Save(mProfile); int mSecurityId = mSecurityEntityProfile.Id; NameValuePairUtility.UpdateRoles(mID, mSecurityId, mRoles, mProfile); NameValuePairUtility.UpdateGroups(mID, mSecurityId, mGroups, mProfile); return(this.Ok(mRetVal)); }