public CallContext AllowIPSave(AllowIP entity, CallContext resultContext) { resultContext.securitySettings = ETEMEnums.SecuritySettings.AllowIPSave; CallContext resContext = new AllowIPBL().EntitySave <Setting>(entity, resultContext); return(resContext); }
public override void UserControlLoad() { if (this.ownerPage == null) { throw new UMSException("Current Page is null or is not inheritor of BasicPage."); } this.pnlFormData.Visible = true; this.currentEntity = this.ownerPage.AdminClientRef.GetAllowIPByID(this.CurrentEntityMasterID); if (currentEntity != null) { this.tbxIP.Text = currentEntity.IP; this.tbxCommnet.Text = currentEntity.Commnet; this.chbxAllow.Checked = currentEntity.Allow; this.hdnRowMasterKey.Value = currentEntity.EntityID.ToString(); } else { this.lbResultContext.Text = ""; this.tbxIP.Text = string.Empty; this.tbxCommnet.Text = string.Empty; this.chbxAllow.Checked = false; this.hdnRowMasterKey.Value = string.Empty; } }
protected void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.hdnRowMasterKey.Value)) { this.currentEntity = new AllowIP(); } else { this.currentEntity = this.ownerPage.AdminClientRef.GetAllowIPByID(this.hdnRowMasterKey.Value); if (this.currentEntity == null) { this.lbResultContext.Text = String.Format(BaseHelper.GetCaptionString("Entity_Setting_Not_Found_By_ID"), this.hdnRowMasterKey.Value); this.ownerPage.FormLoad(); return; } } currentEntity.IP = this.tbxIP.Text; currentEntity.Commnet = this.tbxCommnet.Text; currentEntity.Allow = this.chbxAllow.Checked; CallContext resultContext = new CallContext(); resultContext.CurrentConsumerID = this.ownerPage.UserProps.IdUser; resultContext = this.ownerPage.AdminClientRef.AllowIPSave(currentEntity, resultContext); this.lbResultContext.Text = resultContext.Message; this.hdnRowMasterKey.Value = resultContext.EntityID; this.CurrentEntityMasterID = resultContext.EntityID; this.ownerPage.FormLoad(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); ///Страници, които не изискват login if ( this.UserProps == null && this.CurrentPageFullName() != Share.Login.formResource.PageFullName ) { Response.Redirect(Share.Login.formResource.PagePath); } UserProps userProps = GetOnlineUsers().Where(s => s.SessionID == this.Session.SessionID).FirstOrDefault() as UserProps; if (userProps != null && userProps.IsKilled) { Session.RemoveAll(); Session.Abandon(); Response.Redirect(Share.Login.formResource.PagePath); } if (userProps != null && CurrentPagePath() != OnlineUsersList.formResource.PagePath) { userProps.LastPageName = CurrentPagePath(); ModuleDataView module = DictionaryModules.Where(m => m.Key == CurrentModule()).FirstOrDefault().Value; MenuNodeDataView node = null; if (FormContext.QueryString["Node"] != null) { node = DictionaryMenuNodes.Where(m => m.Key == FormContext.QueryString["Node"].ToString()).FirstOrDefault().Value; } if (module != null) { userProps.LastModuleName = module.ModuleName; } if (node != null) { userProps.LastPageName = node.name; } } #region filter by ip this.currentModuleObject = this.AdminClientRef.GetModuleBySysName(this.CurrentModule()); if (this.CurrentPageFullName() != Share.Login.formResource.PageFullName && this.currentModuleObject != null && this.currentModuleObject.NeedCheck && !Request.UserHostAddress.Equals("::1")) { AllowIP allowIP = this.AdminClientRef.GetEntityByIPAddress(Request.UserHostAddress); if (allowIP == null || !allowIP.Allow) { Response.Redirect("~/UI/InternalPageInfo.aspx"); } } #endregion #region filter by modules List <string> listPermittedModules = new List <string>() { Constants.MODULE_NOMENCLATURES, Constants.MODULE_SUPPORT_HISTORY, Constants.MODULE_SETTINGS, Constants.MODULE_PERMISSION, Constants.MODULE_INOUTDOCUMENT, }; if (this.CurrentPageFullName() != Share.Login.formResource.PageFullName && currentModuleObject != null && this.UserProps.Roles.Any(a => a.Name == "VIEW") && listPermittedModules.Any(s => s == currentModuleObject.ModuleSysName)) { Response.Redirect("~/UI/InternalPageInfo.aspx"); } #endregion if (!IsPostBack) { InitReloadParentPageControl(); } AjaxControlToolkit.ToolkitScriptManager.RegisterClientScriptBlock(this, this.GetType(), "IsNumeric", BaseHelper.JS_SCRIPT_IS_NUMERIC, false); }