/// <summary>Begin page running after session validations</summary> private void Go() { this.user = Session["User"] as ApplicationUser; this.Company = Session["Company"] as Company; GetCompany(); this.Dictionary = Session["Dictionary"] as Dictionary <string, string>; this.master = this.Master as Giso; this.master.AdminPage = true; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); this.master.AddBreadCrumb("Item_CompanyData"); this.master.Titulo = "Item_CompanyData"; this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(Convert.ToInt32(Session["CompanyId"]), TargetType.Company); this.RenderCountries(); this.formFooter = new FormFooter(); this.formFooter.AddButton(new UIButton { Id = "BtnSave", Action = "success", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"] }); this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); this.ImgLogo = new ImageSelector { Name = "Equipment", ImageName = string.Format(CultureInfo.InvariantCulture, @"images\Logos\{0}", this.Logo), Width = 300, Height = 300, Label = this.Dictionary["Item_Equipment_Field_Image_Label"] }; this.RenderCountriesTab(); this.LtIdiomas.Text = "<option value=\"es\"" + (this.user.Language == "es" ? " selected=\"selected\"" : string.Empty) + ">Castellano</option>"; this.LtIdiomas.Text += "<option value=\"ca\"" + (this.user.Language == "ca" ? " selected=\"selected\"" : string.Empty) + ">Català </option>"; this.LtIdiomas.Text += "<option value=\"en\"" + (this.user.Language == "en" ? " selected=\"selected\"" : string.Empty) + ">English</option>"; }
/// <summary>Begin page running after session validations</summary> private void Go() { this.user = Session["User"] as ApplicationUser; this.company = Session["company"] as Company; this.Dictionary = Session["Dictionary"] as Dictionary <string, string>; if (this.Request.QueryString["id"] != null) { this.processId = Convert.ToInt32(this.Request.QueryString["id"]); } string label = this.processId == -1 ? "Item_Process_Button_NewLabel" : "Item_Process_Button_Edit"; this.master = this.Master as Giso; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); this.master.AddBreadCrumb("Item_Processes", "ProcesosList.aspx", Constant.NotLeaft); this.master.AddBreadCrumb(label); this.master.Titulo = label; this.formFooter = new FormFooter(); this.formFooter.AddButton(new UIButton { Id = "BtnRestaurar", Hidden = true, Icon = "icon-undo", Text = this.Dictionary["Item_Process_Btn_Restaurar"], Action = "primary" }); this.formFooter.AddButton(new UIButton { Id = "BtnAnular", Hidden = true, Icon = "icon-ban-circle", Text = this.Dictionary["Item_Process_Btn_Anular"], Action = "danger" }); this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success" }); this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); this.process = Process.Empty; if (processId > 0) { this.process = new Process(this.processId, this.company.Id); if (this.process.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); this.process = Process.Empty; } this.formFooter.ModifiedBy = this.process.ModifiedBy.Description; this.formFooter.ModifiedOn = this.process.ModifiedOn; this.master.TitleInvariant = true; this.master.Titulo = string.Format("{0}: <strong>{1}</strong>", this.Dictionary["Item_Process"], this.process.Description); this.RenderIndicatorsData(); this.RenderDocuments(); } this.RenderProcesosData(); this.RenderCmbUsers(); if (!IsPostBack) { this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(this.processId, TargetType.Process); } }
/// <summary>Begin page running after session validations</summary> private void Go() { this.user = (ApplicationUser)Session["User"]; this.company = (Company)Session["company"]; this.dictionary = Session["Dictionary"] as Dictionary <string, string>; // Security access control if (!this.user.HasGrantToRead(ApplicationGrant.Rule)) { this.Response.Redirect("NoPrivileges.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); } // Parameters control if (this.Request.QueryString["id"] != null) { this.RuleId = Convert.ToInt32(this.Request.QueryString["id"].ToString()); } this.master = this.Master as Giso; this.master.AdminPage = true; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); this.formFooter = new FormFooter(); if (this.user.HasGrantToWrite(ApplicationGrant.Rule)) { this.formFooter.AddButton(new UIButton() { Id = "BtnSave", Icon = "icon-ok", Text = this.dictionary["Common_Accept"], Action = "success" }); } this.formFooter.AddButton(new UIButton() { Id = "BtnCancel", Icon = "icon-undo", Text = this.dictionary["Common_Cancel"] }); if (this.RuleId > 0) { this.Rule = Rules.GetById(this.company.Id, this.RuleId); if (this.Rule.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", false); Context.ApplicationInstance.CompleteRequest(); } this.formFooter.ModifiedBy = this.Rule.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Rule.ModifiedOn; this.master.TitleInvariant = true; this.RenderHistoryTable(); } else { this.Rule = Rules.Empty; } if (!IsPostBack) { if (this.user.HasTraceGrant()) { this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(this.RuleId, TargetType.Rules); } } string label = this.RuleId == -1 ? "Item_Rules_Button_New" : string.Format("{0}: <strong>{1}</strong>", this.dictionary["Item_Rule"], this.Rule.Description); this.master.AddBreadCrumb("Item_Rules", "RulesList.aspx", false); this.master.AddBreadCrumb("Item_Rules_Button_New"); this.master.Titulo = label; this.RenderBusinessRiskTable(); }
/// <summary>Begin page running after session validations</summary> private void Go() { if (this.Request.QueryString["id"] != null) { this.employeeId = Convert.ToInt32(this.Request.QueryString["id"].ToString()); } if (this.Request.QueryString["New"] != null) { this.returnScript = "document.location = 'EmployeesList.aspx';"; } else { this.returnScript = "document.location = referrer;"; } this.formFooter = new FormFooter(); this.formFooterLearning = new FormFooter(); this.formFooterInternalLearning = new FormFooter(); this.user = (ApplicationUser)Session["User"]; this.company = (Company)Session["company"]; this.Dictionary = Session["Dictionary"] as Dictionary <string, string>; string label = this.employeeId == -1 ? "Item_Employee_Button_New" : "Item_Employee_Title_EmployeeData"; this.master = this.Master as Giso; this.master.AdminPage = true; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); this.master.AddBreadCrumb("Item_Employees", "EmployeesList.aspx", false); this.master.AddBreadCrumb("Item_Employee_Title_EmployeeData"); this.master.TitleInvariant = true; this.master.Titulo = this.Dictionary["Item_Employee_Title_EmployeeData"]; if (employeeId > 0) { bool grantDelete = UserGrant.HasWriteGrant(this.user.Grants, ApplicationGrant.Employee); bool grantJobPositionView = UserGrant.HasReadGrant(this.user.Grants, ApplicationGrant.JobPosition); bool grantDepartmentsView = UserGrant.HasReadGrant(this.user.Grants, ApplicationGrant.Department); this.Employee = new Employee(this.employeeId, true); if (this.Employee.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", false); Context.ApplicationInstance.CompleteRequest(); this.Employee = Employee.Empty; } if (this.Employee.DisabledDate.HasValue) { this.Active = false; } label = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.Dictionary["Item_Employee"], Employee.FullName); this.master.Titulo = label; this.departmentsEmployeeJson = new StringBuilder("[").Append(Environment.NewLine); this.departmentsEmployeeJson.Append(Environment.NewLine).Append("\t]"); this.jobPositionAcademic = new StringBuilder(); this.jobPositionSpecific = new StringBuilder(); this.jobPositionWorkExperience = new StringBuilder(); this.jobPositionHability = new StringBuilder(); var tableJobAsignements = new StringBuilder(); this.jobpositionEmployeeJson = new StringBuilder("["); bool firstJobPosition = true; this.Employee.ObtainJobPositionsHistoric(); var JobPositionAdded = new List <long>(); foreach (var jobAsignement in this.Employee.JobPositionAssignment) { if (!JobPositionAdded.Contains(jobAsignement.JobPosition.Id) || true) { JobPositionAdded.Add(jobAsignement.JobPosition.Id); var actualJobPosition = new JobPosition(jobAsignement.JobPosition.Id, this.company.Id); if (firstJobPosition) { firstJobPosition = false; } else { this.jobpositionEmployeeJson.Append(","); } this.jobpositionEmployeeJson.Append(jobAsignement.Json); if (!string.IsNullOrEmpty(actualJobPosition.AcademicSkills)) { if (this.jobPositionAcademic.ToString().IndexOf(actualJobPosition.AcademicSkills) == -1) { this.jobPositionAcademic.Append(actualJobPosition.AcademicSkills); this.jobPositionAcademic.Append(Environment.NewLine); } } if (!string.IsNullOrEmpty(actualJobPosition.SpecificSkills)) { if (this.jobPositionSpecific.ToString().IndexOf(actualJobPosition.SpecificSkills) == -1) { this.jobPositionSpecific.Append(actualJobPosition.SpecificSkills); this.jobPositionSpecific.Append(Environment.NewLine); } } if (!string.IsNullOrEmpty(actualJobPosition.WorkExperience)) { if (this.jobPositionWorkExperience.ToString().IndexOf(actualJobPosition.WorkExperience) == -1) { this.jobPositionWorkExperience.Append(actualJobPosition.WorkExperience); this.jobPositionWorkExperience.Append(Environment.NewLine); } } if (!string.IsNullOrEmpty(actualJobPosition.Habilities)) { if (this.jobPositionHability.ToString().IndexOf(actualJobPosition.Habilities) == -1) { this.jobPositionHability.Append(actualJobPosition.Habilities); this.jobPositionHability.Append(Environment.NewLine); } } tableJobAsignements.Append(jobAsignement.TableRow(this.Dictionary, grantDelete, grantJobPositionView, grantDepartmentsView)); } } this.jobpositionEmployeeJson.Append("]"); this.TableExperiencia.Text = tableJobAsignements.ToString(); this.companyUserNames = new StringBuilder(); bool firstUserName = true; foreach (var userName in ApplicationUser.CompanyUserNames(this.company.Id)) { if (firstUserName) { firstUserName = false; } else { this.companyUserNames.Append(","); } this.companyUserNames.Append(string.Format(@"{{""UserName"":""{0}"",""EmployeeId"":{1}}}", userName.Key, userName.Value)); } var tableAssistance = new StringBuilder(); this.Employee.ObtainLearningAssistance(); foreach (LearningAssistance assistance in this.Employee.LearningAssistance) { tableAssistance.Append(assistance.TableRowProfile(this.Dictionary)); } this.TableLearningAssistance.Text = tableAssistance.ToString(); this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(this.employeeId, TargetType.Employee); this.Employee.ObtainEmployeeSkills(); this.formFooter.ModifiedBy = this.Employee.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Employee.ModifiedOn; if (this.Employee.EmployeeSkills != null && this.Employee.EmployeeSkills.ModifiedBy != null) { this.formFooterLearning.ModifiedBy = this.Employee.EmployeeSkills.ModifiedBy.Description; this.formFooterLearning.ModifiedOn = this.Employee.EmployeeSkills.ModifiedOn; } if (this.Employee.User == null) { this.Employee.User = ApplicationUser.GetByEmployee(this.Employee.Id, this.Employee.CompanyId); this.employeeUserId = this.Employee.User.Id; this.userName = this.Employee.User.UserName; } this.RenderDocuments(); } else { this.Employee = Employee.Empty; this.departmentsEmployeeJson = new StringBuilder(Constant.EmptyJsonList); this.jobpositionEmployeeJson = new StringBuilder(Constant.EmptyJsonList); this.employeeUserId = -1; this.userName = string.Empty; this.companyUserNames = new StringBuilder(); this.Employee.Address = EmployeeAddress.Empty; } this.RenderCountries(); if (this.Active) { if (employeeId > 0) { this.formFooter.AddButton(new UIButton { Id = "BtnAnular", Icon = "icon-ban-circle", Text = this.Dictionary["Item_Employee_Btn_Inactive"], Action = "danger" }); } this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success" }); } else { this.formFooter.AddButton(new UIButton { Id = "BtnRestore", Icon = "icon-undo", Text = this.Dictionary["Item_Employee_Button_Restore"], Action = "primary" }); //this.formFooter.AddButton(new UIButton { Id = "BtnRestore", Icon = "icon-ok", Text = this.Dictionary["Item_Employee_Button_Restore"], Action = "success" }); } this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); if (this.Active) { this.formFooterInternalLearning.ModifiedBy = this.formFooter.ModifiedBy; this.formFooterInternalLearning.ModifiedOn = this.formFooter.ModifiedOn; this.formFooterLearning.AddButton(new UIButton { Id = "BtnSaveFormacion", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success" }); this.formFooterLearning.AddButton(new UIButton { Id = "BtnCancelFormacion", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); this.formFooterInternalLearning.AddButton(new UIButton { Id = "BtnSaveInternalLearning", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success" }); this.formFooterInternalLearning.AddButton(new UIButton { Id = "BtnCancelInternalLearning", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); } this.SelectedTab = "home"; if (this.Request.QueryString["Tab"] != null) { SelectedTab = this.Request.QueryString["Tab"].ToString().Trim().ToLowerInvariant(); } this.tabBar.AddTab(new Tab { Id = "home", Selected = SelectedTab == "home", Active = true, Label = this.Dictionary["Item_Employee_Tab_Principal"], Available = true }); this.tabBar.AddTab(new Tab { Id = "formacion", Available = true, Active = this.employeeId > 0, Hidden = this.employeeId < 1, Label = this.Dictionary["Item_Employee_Tab_Learning"] }); this.tabBar.AddTab(new Tab { Id = "formacionInterna", Selected = SelectedTab == "formacioninterna", Available = true, Active = this.employeeId > 0, Hidden = this.employeeId < 1, Label = this.Dictionary["Item_Employee_Tab_InternalLearning"] }); this.tabBar.AddTab(new Tab { Id = "uploadFiles", Selected = SelectedTab == "uploadfiles", Available = true, Active = this.employeeId > 0, Hidden = this.employeeId < 1, Label = this.Dictionary["Item_Employee_Tab_UploadFiles"] }); //// this.tabBar.AddTab(new Tab { Id = "trazas", Available = this.user.HasTraceGrant() && this.employeeId > 0, Active = this.employeeId > 0, Label = this.dictionary["Item_Employee_Tab_Traces"] }); }
/// <summary>Begin page running after session validations</summary> private void Go() { this.company = this.Session["company"] as Company; this.Dictionary = this.Session["Dictionary"] as Dictionary <string, string>; this.user = this.Session["User"] as ApplicationUser; if (this.Request.QueryString["id"] != null) { this.departmentId = Convert.ToInt64(this.Request.QueryString["id"]); } string label = "Item_Department_Title_DepartmentDetails"; this.master = this.Master as Giso; this.master.AdminPage = true; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); this.master.AddBreadCrumb("Item_Departments", "DepartmentsList.aspx", Constant.NotLeaft); this.master.AddBreadCrumb(label); this.master.Titulo = label; if (!this.Page.IsPostBack) { this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(this.departmentId, TargetType.Department); } this.formFooter = new FormFooter(); this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Action = "success", Text = this.Dictionary["Common_Accept"] }); this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); if (this.departmentId != -1) { this.department = new Department(this.departmentId, this.company.Id); if (this.department.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); this.department = Department.Empty; } this.formFooter.ModifiedBy = this.department.ModifiedBy.Description; this.formFooter.ModifiedOn = this.department.ModifiedOn; var tableEmployees = new StringBuilder(); foreach (var employee in this.department.Employees) { tableEmployees.Append(employee.DepartmentListRow(this.Dictionary, this.departmentId)); } this.TableEmployees.Text = tableEmployees.ToString(); var tableJobPosition = new StringBuilder(); foreach (var jobPosition in this.department.JobPositions) { tableJobPosition.Append(jobPosition.EmployeeRow(this.Dictionary)); } this.TableJobPosition.Text = tableJobPosition.ToString(); label = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.Dictionary["Item_Department"], this.department.Description); this.master.TitleInvariant = true; this.master.Titulo = label; } else { this.department = Department.Empty; this.TableEmployees.Text = string.Empty; this.TableJobPosition.Text = string.Empty; } this.tabBar.AddTab(new Tab { Id = "home", Available = true, Active = true, Selected = true, Label = this.Dictionary["Item_Department_Tab_Principal"] }); // this.tabBar.AddTab(new Tab() { Id = "trazas", Label = this.dictionary["Item_Department_Tab_Traces"], Active = this.departmentId > 0, Available = this.user.HasTraceGrant() }); }
/// <summary>Begin page running after session validations</summary> private void Go() { this.user = Session["User"] as ApplicationUser; this.company = Session["company"] as Company; this.Dictionary = Session["Dictionary"] as Dictionary <string, string>; // Security access control if (!this.user.HasGrantToRead(ApplicationGrant.Auditory)) { this.Response.Redirect("NoPrivileges.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); } // Parameters control if (this.Request.QueryString["id"] != null) { this.auditoryId = Convert.ToInt32(this.Request.QueryString["id"]); } this.master = this.Master as Giso; this.master.AdminPage = true; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); this.formFooter = new FormFooter(); this.formFooter.AddButton(new UIButton { Id = "BtnPrint", Icon = "icon-file-pdf", Text = this.Dictionary["Common_PrintPdf"], Action = "success", ColumnsSpan = 12 }); if (this.user.HasGrantToWrite(ApplicationGrant.Auditory)) { this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success" }); } this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); if (this.auditoryId > 0) { this.Auditory = Auditory.ById(this.auditoryId, this.company.Id); if (this.Auditory.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); } this.formFooter.ModifiedBy = this.Auditory.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Auditory.ModifiedOn; this.master.TitleInvariant = true; this.RenderDocuments(); } else { this.Auditory = Auditory.Empty; if (this.Request.QueryString["t"] != null) { this.Auditory.Type = Convert.ToInt32(this.Request.QueryString["t"] as string); } } if (!IsPostBack) { if (this.user.HasTraceGrant()) { this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(this.auditoryId, TargetType.Auditory); } } string label = this.auditoryId == -1 ? this.Dictionary["Item_Auditory_BreadCrumb_Edit"] : string.Format("{0} {2}: <strong>{1}</strong>", this.Dictionary["Item_Auditory"], this.Auditory.Description, this.Dictionary["Item_Adutory_Type_Label_" + this.Auditory.Type.ToString()].ToLowerInvariant()); this.master.AddBreadCrumb("Item_Auditories", "AuditoryList.aspx", Constant.NotLeaft); this.master.AddBreadCrumbInvariant(this.Dictionary["Item_Auditory_BreadCrumb_Edit"] + " " + this.Dictionary["Item_Adutory_Type_Label_" + this.Auditory.Type.ToString()].ToLowerInvariant()); this.master.TitleInvariant = true; this.master.Titulo = label; this.FillLists(); this.RenderRealActions(); this.RenderBarPopups(); }
/// <summary>Begin page running after session validations</summary> private void Go() { this.Company = (Company)Session["company"]; this.dictionary = Session["Dictionary"] as Dictionary <string, string>; this.ApplicationUser = Session["User"] as ApplicationUser; if (this.Request.QueryString["id"] != null) { this.DocumentId = Convert.ToInt32(this.Request.QueryString["id"]); } string label = this.DocumentId == -1 ? "Item_Document_Tab_Details" : "Item_Document_Tab_Details"; this.master = this.Master as Giso; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); this.master.AddBreadCrumb("Item_Documents", "Documents.aspx", Constant.NotLeaft); this.master.AddBreadCrumb(label); this.master.Titulo = label; this.formFooter = new FormFooter(); if (this.DocumentId != -1) { this.Document = Document.ById(this.DocumentId, this.Company.Id); if (this.Document.Id == 0) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); this.Document = new Document(); } this.formFooter.ModifiedBy = this.Document.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Document.ModifiedOn; label = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.dictionary["Item_Document"], this.Document.Description); this.master.TitleInvariant = true; this.master.Titulo = label; } else { this.Document = new Document(); } this.RenderHistorico(); this.FillCmbConservacion(); if (!this.IsPostBack) { this.dictionary = Session["Dictionary"] as Dictionary <string, string>; this.FillCmbConservacion(); this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(this.DocumentId, TargetType.Document); } if (this.DocumentId != -1) { this.formFooter.AddButton(new UIButton { Id = "BtnRestaurar", Icon = "icon-undo", Text = this.dictionary["Item_Document_Btn_Restaurar"], Action = "primary", Hidden = !this.Document.EndDate.HasValue }); this.formFooter.AddButton(new UIButton { Id = "BtnAnular", Icon = "icon-ban-circle", Text = this.dictionary["Item_Document_Btn_Anular"], Action = "danger", Hidden = this.Document.EndDate.HasValue }); } this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Text = this.dictionary["Common_Accept"], Action = "success" }); this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.dictionary["Common_Cancel"] }); }
/// <summary>Begin page running after session validations</summary> private void Go() { this.user = Session["User"] as ApplicationUser; this.company = Session["company"] as Company; this.Dictionary = Session["Dictionary"] as Dictionary <string, string>; // Security access control if (!this.user.HasGrantToRead(ApplicationGrant.JobPosition)) { this.Response.Redirect("NoPrivileges.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); } // Parameters control if (this.Request.QueryString["id"] != null) { this.jobPositionId = Convert.ToInt32(this.Request.QueryString["id"]); } this.master = this.Master as Giso; this.master.AdminPage = true; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); this.formFooter = new FormFooter(); if (this.user.HasGrantToWrite(ApplicationGrant.JobPosition)) { this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success" }); } this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); if (jobPositionId > 0) { this.Cargo = new JobPosition(this.jobPositionId, this.company.Id); if (this.Cargo.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); } this.formFooter.ModifiedBy = this.Cargo.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Cargo.ModifiedOn; this.RenderEmployees(); this.master.TitleInvariant = true; this.RenderDocuments(); } else { this.Cargo = JobPosition.Empty; this.TableEmployees.Text = string.Empty; } if (!IsPostBack) { if (this.user.HasTraceGrant()) { this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(this.jobPositionId, TargetType.JobPosition); } } string label = this.jobPositionId == -1 ? "Item_JobPosition_BreadCrumb_Edit" : string.Format("{0}: <strong>{1}</strong>", this.Dictionary["Item_JobPosition"], this.Cargo.Description); this.master.AddBreadCrumb("Item_JobPositions", "CargosList.aspx", Constant.NotLeaft); this.master.AddBreadCrumb("Item_JobPosition_BreadCrumb_Edit"); this.master.Titulo = label; }
/// <summary>Begin page running after session validations</summary> private void Go() { this.user = Session["User"] as ApplicationUser; this.company = Session["company"] as Company; this.dictionary = Session["Dictionary"] as Dictionary <string, string>; this.formFooter = new FormFooter(); this.formFooter.AddButton(new UIButton { Id = "BtnPrint", Icon = "icon-file-pdf", Text = this.dictionary["Common_PrintPdf"], Action = "success", ColumnsSpan = 12 }); this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success" }); this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); if (this.Request.QueryString["id"] != null) { this.learningId = Convert.ToInt32(this.Request.QueryString["id"]); } if (this.learningId != -1) { this.learning = new Learning(this.learningId, this.company.Id); if (this.learning.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); this.learning = Learning.Empty; } this.formFooter.ModifiedBy = this.learning.ModifiedBy.Description; this.formFooter.ModifiedOn = this.learning.ModifiedOn; this.learning.ObtainAssistance(); this.RenderDocuments(); } else { this.learning = Learning.Empty; } string label = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.dictionary["Item_Learning"], this.learning.Description); if (this.learningId == -1) { label = "Item_Learning_NewLabel"; } this.master = this.Master as Giso; this.master.TitleInvariant = this.learningId != -1; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); this.master.AddBreadCrumb("Item_Learnings", "FormacionList.aspx", Constant.NotLeaft); this.master.AddBreadCrumb("Item_Learning_NewLabel"); this.master.Titulo = label; var tableAssistance = new StringBuilder(); jsonAssistance = new StringBuilder("["); this.assistans = new StringBuilder(); bool first = true; foreach (var assistance in this.learning.Assistance) { if (first) { first = false; } else { jsonAssistance.Append(","); this.assistans.Append(","); } tableAssistance.Append(assistance.LearningRow(this.dictionary, this.learning.Status)); jsonAssistance.Append(string.Format(@"{{""EmployeeId"":{0},""AssistantId"":{1}}}", assistance.Employee.Id, assistance.Id)); this.assistans.Append(assistance.Id); } jsonAssistance.Append("]"); this.TableAssistance.Text = tableAssistance.ToString(); this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(this.learningId, TargetType.Learning); this.LtYearPrevistos.Text = string.Format(CultureInfo.InvariantCulture, @"<option value="""">{0}</option>", this.dictionary["Common_Year"]); for (int x = DateTime.Now.Year; x < DateTime.Now.Year + 3; x++) { string selected = string.Empty; if (this.learning.Id > 0) { if (this.learning.DateEstimated.Year == x) { selected = " selected=\"selected\""; } } this.LtYearPrevistos.Text += string.Format(@"<option value=""{0}""{1}>{0}</option>", x, selected); } }