protected void Page_Load(object sender, EventArgs e) { try { if (Session["UserIdentity"] == null) { Response.Redirect("../Views/frmLogin.aspx"); } oPreseneter = new MasterPresenter(this, new DBMaster()); if (!IsPostBack) { iPerfil = Utils.GetPerfilUsuario; if (eSearchMenu != null) { eSearchMenu(sender, e); } } } catch (Exception) { alert("Error de conexión"); } }
public MasterView() { DataObjects.UISettings.UIDistance = 5; InitializeComponent(); MasterPreseneter = new MasterPresenter(this); var fp = new FieldPresenter(this, MasterPreseneter); var hp = new HeightMapPresenter(this, MasterPreseneter); var vp = new Visualization3DPresenter(this); MasterPreseneter.SetupPresenters(fp, hp, vp); initMainView(); init3DView(); initHeightmapView(); initFieldView(); pbFieldCanvas.Focus(); }
public SiteMaster() { Thread.CurrentThread.CurrentUICulture = new CultureInfo(Global.GetDefaultCultureCode()); presenter = new MasterPresenter(this); }
public Login() { presenter = new MasterPresenter(); }
/// <summary> /// Initializes the work category group. /// </summary> /// <param name="presenter">The presenter.</param> private void InitializeWorkCategoryGroup(MasterPresenter presenter) { this.masterService = DIContainer.Instance.Resolve<WorkCategoryGroupService>(); presenter.AssignWorkCategoryGroup(this.masterService.RetrieveList(SessionData.Instance.UserInfo.Developer.DeveloperID)); }
/// <summary> /// Initializes the master details. /// </summary> /// <param name="linkType">Type of the link.</param> /// <param name="presenter">The presenter.</param> private void InitializeMasterDetails(string linkType, MasterPresenter presenter) { switch (linkType.ToLower()) { case Client: this.AddBreadcrumbItem(Resources.ManageClients, Url.MasterAction()); this.masterService = DIContainer.Instance.Resolve<ClientService>(); presenter.InactiveApplicable = true; break; case Designation: this.AddBreadcrumbItem(Resources.ManageDesignations, Url.MasterAction()); this.masterService = DIContainer.Instance.Resolve<DesignationService>(); break; case EstimationCategory: this.AddBreadcrumbItem(Resources.ManageEstimationCategories, Url.MasterAction()); this.InitializeRoleGroup(presenter); this.masterService = DIContainer.Instance.Resolve<EstimationCategoryService>(); presenter.IsRoleGroup = true; break; case RoleGroup: this.AddBreadcrumbItem(Resources.ManageRoleGroups, Url.MasterAction()); this.masterService = DIContainer.Instance.Resolve<RoleGroupService>(); break; case Role: this.AddBreadcrumbItem(Resources.ManageRoles, Url.MasterAction()); this.InitializeRoleGroup(presenter); this.masterService = DIContainer.Instance.Resolve<RoleService>(); presenter.GroupApplicable = true; presenter.IsRoleGroup = true; break; case WorkCategoryGroup: this.AddBreadcrumbItem(Resources.ManageWorkCategoryGroup, Url.MasterAction()); this.masterService = DIContainer.Instance.Resolve<WorkCategoryGroupService>(); break; case WorkCategory: this.AddBreadcrumbItem(Resources.ManageWorkCategory, Url.MasterAction()); this.InitializeWorkCategoryGroup(presenter); this.masterService = DIContainer.Instance.Resolve<WorkCategoryService>(); presenter.GroupApplicable = true; break; } }
/// <summary> /// Adds the update. /// </summary> /// <param name="masterDetailId">The masterDetail Id id.</param> /// <param name="name">The name.</param> /// <param name="isInActive">The isInActive.</param> /// <param name="roleGroupId">The role group Id.</param> /// <param name="workCategoryGroupId">The work category group Id.</param> /// <param name="currentLink">The current link.</param> /// <returns> /// Add Update page /// </returns> public ActionResult SaveMasterDetails(string masterDetailId, string name, string isInActive, string roleGroupId, string workCategoryGroupId, string currentLink) { this.AssignMasterService(currentLink); MasterPresenter presenter = new MasterPresenter(); if (!string.IsNullOrWhiteSpace(masterDetailId)) { presenter.MasterDetail.MasterDetailId = Convert.ToInt32(masterDetailId); } if (currentLink == "manageClient") { presenter.MasterDetail.IsInactive = Convert.ToBoolean(isInActive); } else if ((currentLink == "manageRole") || (currentLink == "manageEstimationCategory")) { presenter.MasterDetail.GroupId = Convert.ToInt32(roleGroupId); } else if (currentLink == "manageWorkCategory") { presenter.MasterDetail.GroupId = Convert.ToInt32(workCategoryGroupId); } presenter.MasterDetail.Name = name; ErrorListItem error = this.masterService.Validate(presenter.MasterDetail, SessionData.Instance.UserInfo.Developer.DeveloperID); if (error != null) { return this.Json(error.Message); } this.masterService.InsertOrUpdate(presenter.MasterDetail, SessionData.Instance.UserInfo.Developer.DeveloperID); return null; }
/// <summary> /// Adds the update. /// </summary> /// <param name="masterDetailId">The master detail Id.</param> /// <param name="name">The name.</param> /// <param name="roleGroupType">The role group name.</param> /// <param name="workCategoryGroupType">The work category group type.</param> /// <param name="currentLink">The current link.</param> /// <returns> /// Add Update page /// </returns> public ActionResult ValidateMasterDetails(string masterDetailId, string name, string roleGroupType, string workCategoryGroupType, string currentLink) { MasterPresenter presenter = new MasterPresenter(); if (masterDetailId != null) { if ((currentLink == "manageRole") || (currentLink == "manageEstimationCategory")) { if (string.IsNullOrEmpty(roleGroupType)) { presenter.ValidationErrors.Add(GroupName, Resources.GroupNameError); } } if (currentLink == "manageWorkCategory") { if (string.IsNullOrEmpty(workCategoryGroupType)) { presenter.ValidationErrors.Add(WorkCategoryName, Resources.GroupNameError); } } if (string.IsNullOrEmpty(name.Trim())) { presenter.ValidationErrors.Add(Name, Resources.NameError); } } return new JsonResult { Data = presenter, MaxJsonLength = int.MaxValue }; }
/// <summary> /// Function to retrieve manage master page. /// </summary> /// <param name="linkType">The link type.</param> /// <returns>Manage manage master page</returns> public ActionResult ManageMaster(string linkType) { MasterPresenter presenter = new MasterPresenter(); this.AddBreadcrumbItem(Resources.ManageMaster, Url.MasterAction()); this.InitializeMasterDetails(linkType, presenter); presenter.LinkType = linkType; return this.View(presenter); }
/// <summary> /// Function to retrieve index page. /// </summary> /// <returns>Index page</returns> public ActionResult Index() { MasterPresenter preseneter = new MasterPresenter(); var getTicketSetting = this.ticketService.RetrieveTicketSettings(Convert.ToString(SessionData.Instance.UserInfo.Developer.DeveloperID)); SessionData.Instance.SetEmailFrequency = Convert.ToInt32(getTicketSetting.EmailFrequency, CultureInfo.CurrentCulture); this.AddBreadcrumbItem(Resources.Masters, Url.MasterAction()); return this.View(preseneter); }