/// <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.Questionary)) { this.Response.Redirect("NoPrivileges.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); } // Parameters control if (this.Request.QueryString["c"] != null) { this.questionnaireId = Convert.ToInt32(this.Request.QueryString["c"]); } this.Auditory = Auditory.Empty; if (this.Request.QueryString["a"] != null) { this.auditoryId = Convert.ToInt32(this.Request.QueryString["a"]); this.Auditory = Auditory.ById(this.auditoryId, this.company.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.questionnaireId > 0) { this.Questionary = Questionary.ById(this.questionnaireId, this.company.Id); if (this.Questionary.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); } this.formFooter.ModifiedBy = this.Questionary.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Questionary.ModifiedOn; this.master.TitleInvariant = true; this.observations = AuditoryCuestionarioObservations.ById(this.questionnaireId, this.auditoryId, this.company.Id); } else { this.Questionary = Questionary.Empty; } string label = this.questionnaireId == -1 ? "Item_Questionary_BreadCrumb_Edit" : string.Format("{0}: <strong>{1}</strong>", this.Dictionary["Item_Questionary"], this.Questionary.Description); this.master.AddBreadCrumb("Item_Questionaries", "QuestionaryList.aspx", Constant.NotLeaft); this.master.AddBreadCrumb("Item_Questionary_BreadCrumb_Edit"); this.master.Titulo = label; this.FillLists(); }
/// <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.user = Session["User"] as ApplicationUser; if (this.Request.QueryString["id"] != null) { this.unidadId = Convert.ToInt32(this.Request.QueryString["id"]); } string label = "Item_Unidad"; 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_Unidades", "UnidadList.aspx", Constant.NotLeaft); this.master.AddBreadCrumb("Item_Unidad_Title"); this.master.Titulo = "Item_Unidad_Title"; 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.unidadId != -1) { this.unidad = Unidad.GetById(this.unidadId, this.company.Id); if (this.unidad.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); this.unidad = Unidad.Empty; } this.formFooter.ModifiedBy = this.UnidadItem.ModifiedBy.Description; this.formFooter.ModifiedOn = this.UnidadItem.ModifiedOn; label = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.dictionary["Item_Unidad"], this.unidad.Description); this.master.TitleInvariant = true; this.master.Titulo = label; } else { this.unidad = Unidad.Empty; } this.tabBar.AddTab(new Tab { Id = "home", Available = true, Active = true, Selected = true, Label = this.dictionary["Item_Unidad_Tab_Principal"] }); //// this.tabBar.AddTab(new Tab() { Id = "trazas", Label = this.dictionary["Item_Provider_Tab_Traces"], Active = this.ProviderId > 0, Available = this.user.HasTraceGrant() }); }
public override string Get() { StringBuilder form = new StringBuilder(); TagBuilder.Begin(form, "form"); TagBuilder.AddId(form, "FormPanel"); TagBuilder.AddStyle(form, "display:none;"); TagBuilder.AddClass(form, ConfigBuilder.GetFormPanelCssClass(this.Config)); TagBuilder.Close(form); TagBuilder.Begin(form, "div"); TagBuilder.AddClass(form, ConfigBuilder.GetFormCssClass(this.Config)); TagBuilder.Close(form); TagBuilder.Begin(form, "div"); TagBuilder.AddClass(form, ConfigBuilder.GetFormDescriptionCssClass(this.Config)); TagBuilder.Close(form); form.Append(Resources.Titles.RequiredFieldDetails); TagBuilder.EndTag(form, "div"); TagBuilder.Begin(form, "table"); TagBuilder.AddAttribute(form, "role", "scrud"); TagBuilder.Close(form); IEnumerable <FieldConfig> fields = FieldConfigHelper.GetFields(this.Values, this.Config, this.Editing); foreach (Field field in fields.Select(fieldConfig => new Field(this.Config, fieldConfig))) { form.Append(field.Get()); } FormFooter footer = new FormFooter(this.Config); form.Append(footer.Get()); TagBuilder.EndTag(form, "table"); TagBuilder.EndTag(form, "div"); TagBuilder.EndTag(form, "form"); return(form.ToString()); }
private void Go() { this.user = Session["User"] as ApplicationUser; this.company = Session["company"] as Company; this.user = new ApplicationUser(this.user.Id); this.dictionary = Session["Dictionary"] as Dictionary <string, string>; this.master = this.Master as Giso; this.master.AddBreadCrumbInvariant(this.user.UserName); this.master.Titulo = "Item_Backup"; this.formFooter = new FormFooter(); this.formFooter.AddButton(new SbrinnaCoreFramework.UI.UIButton { Id = "BtnSave", Text = this.dictionary["Common_Accept"], Icon = "icon-ok", Action = "success" }); this.formFooter.AddButton(new SbrinnaCoreFramework.UI.UIButton { Id = "BtnCancel", Text = this.dictionary["Common_Cancel"], Icon = "icon-undo" }); this.LtExplain.Text = this.dictionary["Item_Backup_Explain"]; }
private void Go() { this.user = Session["User"] as ApplicationUser; this.company = Session["company"] as Company; 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("Paises"); this.master.Titulo = "Paises"; this.formFooter = new FormFooter(); this.formFooter.AddButton(new UIButton() { Id = "BtnSave", Text = this.Dictionary["Common_Accept"], Icon = "icon-ok", Action = "success" }); this.formFooter.AddButton(new UIButton() { Id = "BtnCancel", Text = this.Dictionary["Common_Cancel"], Icon = "icon-undo" }); StringBuilder selected = new StringBuilder(); StringBuilder availables = new StringBuilder(); foreach (Country country in Country.GetAll(this.company.Id)) { if (country.Selected) { selected.Append(country.SelectedTag); } else { availables.Append(country.AvailableTag); } } this.LtSelected.Text = selected.ToString(); this.LtAvailables.Text = availables.ToString(); }
public virtual void Visit(FormFooter formFooter, HtmlContainer htmlContainer) { HtmlDiv htmlDiv = verbose ? new HtmlDiv(formFooter.Path) : new HtmlDiv(); htmlDiv.Class.Add("formFooter"); if (!string.IsNullOrWhiteSpace(formFooter.CssClass)) { htmlDiv.Class.AddRange(formFooter.CssClass.Split(' ').Where(s => s != string.Empty)); } htmlDiv.Class.Add("card-footer"); if (!string.IsNullOrWhiteSpace(formFooter.Path)) { htmlDiv.Class.Add(string.Format("{0}{1}", "formId", formFooter.Path)); } htmlDiv.Hidden.Value = formFooter.IsHidden; htmlContainer.Add(htmlDiv); }
/// <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>; // 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() { if (this.Request.QueryString["id"] != null) { this.IndicadorId = Convert.ToInt32(this.Request.QueryString["id"].ToString()); } if (this.Request.QueryString["New"] != null) { this.returnScript = "document.location = 'IndicadorList.aspx';"; } else { this.returnScript = "document.location = referrer;"; } this.formFooter = new FormFooter(); this.user = (ApplicationUser)Session["User"]; this.company = (Company)Session["company"]; 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); if (user.HasGrantToRead(ApplicationGrant.Indicador)) { this.master.AddBreadCrumb("Item_Indicadores", "IndicadorList.aspx", false); } else { this.master.AddBreadCrumb("Item_Indicadores"); } this.grantToWrite = this.user.HasGrantToWrite(ApplicationGrant.Indicador); if (this.IndicadorId > 0) { this.Indicador = Indicador.ById(this.IndicadorId, this.company.Id); //this.master.AddBreadCrumbInvariant(this.Indicador.Description); this.master.AddBreadCrumb("Item_Indicador_Detail"); if (this.Indicador.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", false); Context.ApplicationInstance.CompleteRequest(); this.Indicador = Indicador.Empty; } this.master.TitleInvariant = true; this.master.Titulo = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.dictionary["Item_Indicador_Header_Description"], this.Indicador.Description); this.formFooter.ModifiedBy = this.Indicador.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Indicador.ModifiedOn; this.formFooter.AddButton(new UIButton { Id = "BtnPrint", Icon = "icon-file-pdf", Text = this.Dictionary["Common_PrintPdf"], Action = "success" }); this.formFooter.AddButton(new UIButton { Id = "BtnRestaurar", Icon = "icon-undo", Text = this.dictionary["Item_Objetivo_Btn_Restaurar"], Action = "primary" }); this.formFooter.AddButton(new UIButton { Id = "BtnAnular", Icon = "icon-ban-circle", Text = this.dictionary["Item_Indicador_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.master.ItemCode = this.Indicador.Description; } else { this.master.AddBreadCrumb("Item_Indicador_Detail"); this.master.Titulo = "Item_Indicador_Detail"; this.Indicador = Indicador.Empty; this.formFooter.ModifiedBy = this.dictionary["Common_New"]; this.formFooter.ModifiedOn = DateTime.Now; 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.tabBar.AddTab(new Tab { Id = "home", Selected = true, Active = true, Label = this.dictionary["Item_Indicador_Tab_Basic"], Available = true }); this.tabBar.AddTab(new Tab { Id = "records", Available = true && this.IndicadorId > 0, Active = this.IndicadorId > 0, Label = this.dictionary["Item_Indicador_Tab_Records"] }); this.tabBar.AddTab(new Tab { Id = "graphics", Available = true && this.IndicadorId > 0, Active = this.IndicadorId > 0, Label = this.dictionary["Item_Indicador_Tab_Graphics"] }); this.tabBar.AddTab(new Tab { Id = "historic", Available = this.user.HasGrantToRead(ApplicationGrant.IncidentActions), Active = this.IndicadorId > 0, Hidden = this.IndicadorId < 1, Label = this.Dictionary["Item_Indicador_TabHistoric"] }); this.RenderForm(); this.UnitsBarPopups = new BarPopup { Id = "Units", DeleteMessage = this.dictionary["Common_DeleteMessage"], BarWidth = 600, UpdateWidth = 600, DeleteWidth = 600, Required = true, RequiredMessage = this.dictionary["Common_Required"], Duplicated = true, DuplicatedMessage = this.dictionary["Common_Error_NameAlreadyExists"], Description = this.dictionary["Item_Unidades"], FieldName = this.dictionary["Common_Name"], BarTitle = this.Dictionary["Item_Providers"] }; }
/// <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.customerId = Convert.ToInt32(this.Request.QueryString["id"].ToString()); } string label = "Item_Customer_Detail"; 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_Customers", "CustomersList.aspx", false); this.master.AddBreadCrumb(label); this.master.Titulo = label; 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.customerId != -1) { this.customer = Customer.ById(this.customerId, this.company.Id); if (this.customer.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", false); Context.ApplicationInstance.CompleteRequest(); this.customer = Customer.Empty; } this.formFooter.ModifiedBy = this.customer.ModifiedBy.Description; this.formFooter.ModifiedOn = this.customer.ModifiedOn; var tableActions = new StringBuilder(); var actions = CustomerIncidentActions.GetByCustomer(this.customer); foreach (var action in actions) { tableActions.Append(action.Row(this.dictionary, this.user.Grants)); } this.TableActions.Text = tableActions.ToString(); label = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.dictionary["Item_Customer"], this.customer.Description); this.master.TitleInvariant = true; this.master.Titulo = label; //// this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(this.customerId, TargetType.Customer); } else { this.customer = Customer.Empty; this.TableActions.Text = string.Empty; } this.tabBar.AddTab(new Tab { Id = "home", Available = true, Active = true, Selected = true, Label = this.dictionary["Item_Customers_Tab_Principal"] }); //// this.tabBar.AddTab(new Tab() { Id = "trazas", Label = this.dictionary["Item_Customers_Tab_Traces"], Active = this.customerId > 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>; 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); } }
/// <summary>Begin page running after session validations</summary> private void Go() { this.ApplicationUser = Session["User"] as ApplicationUser; this.company = Session["company"] as Company; this.ApplicationUser = new ApplicationUser(this.ApplicationUser.Id); this.Dictionary = Session["Dictionary"] as Dictionary <string, string>; this.master = this.Master as Giso; this.master.AddBreadCrumbInvariant(this.ApplicationUser.UserName); this.master.Titulo = this.ApplicationUser.UserName; this.master.TitleInvariant = true; this.CmbShorcuts.Items.Clear(); this.CmbShorcuts.Items.Add(new ListItem(this.Dictionary["Common_None"], "0")); bool first = true; this.shortcutsJson = new StringBuilder("["); foreach (var shortcut in Shortcut.Available(this.ApplicationUser.Id)) { if (first) { first = false; } else { this.shortcutsJson.Append(","); } this.shortcutsJson.Append(shortcut.Json(this.Dictionary)); CmbShorcuts.Items.Add(new ListItem(this.Dictionary[shortcut.Label], shortcut.Id.ToString(CultureInfo.GetCultureInfo("en-us")))); } this.shortcutsJson.Append("]"); this.RenderShortCuts(); if (!this.IsPostBack) { this.CmbShorcuts.Attributes.Add("onchange", "CmbShortcutsChanged(this.value);"); } var avatars = new StringBuilder(); var filePaths = Directory.GetFiles(string.Format(CultureInfo.InvariantCulture, @"{0}/assets/avatars/", this.Request.PhysicalApplicationPath)); foreach (string fileName in filePaths) { string title = this.Dictionary["Common_SelectAll"]; string color = "avatar"; string action = string.Format(CultureInfo.InvariantCulture, @"SelectAvatar('{0}');", Path.GetFileName(fileName)); if (fileName.IndexOf(this.ApplicationUser.Avatar) != -1) { color = "avatarSelected"; title = this.Dictionary["Common_Selected"]; action = string.Format("alert('{0}');", title); } avatars.Append(string.Format(@"<div id=""{0}"" class=""{1}""><img src=""/assets/avatars/{0}"" title=""{2}"" onclick=""{3}"" /></div>", Path.GetFileName(fileName), color, title, action)); } this.LtAvatar.Text = avatars.ToString(); this.formFooter = new FormFooter(); this.formFooter.AddButton(new UIButton { Id = "BtnSave", Text = this.Dictionary["Common_Accept"], Icon = "icon-ok", Action = "success" }); this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Text = this.Dictionary["Common_Cancel"], Icon = "icon-undo" }); }
/// <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>Main action to load page elements</summary> private void Go() { this.Company = this.Session["company"] as Company; this.Dictionary = this.Session["Dictionary"] as Dictionary <string, string>; this.ApplicationUser = this.Session["User"] as ApplicationUser; this.Session["User"] = this.ApplicationUser; if (this.Request.QueryString["id"] != null) { this.OportunityId = Convert.ToInt64(this.Request.QueryString["id"]); } string label = "Item_Oportunity"; this.master = this.Master as Giso; this.master.AdminPage = true; //this.master.Titulo = label; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); if (this.ApplicationUser.HasGrantToRead(ApplicationGrant.Oportunity)) { this.master.AddBreadCrumb("Item_BusinessRisksAndOportunities", "BusinessRisksList.aspx", Constant.NotLeaft); } else { this.master.AddBreadCrumb("Item_Oportunity_Detail"); } this.master.AddBreadCrumb("Item_Oportunity_Detail"); if (!this.Page.IsPostBack) { //this.LtTrazas.Text = ActivityTrace.RenderTraceTableForItem(this.businessRisk, TargetTypes.BusinessRisk); } this.formFooter = new FormFooter(); this.formFooter.AddButton(new UIButton { Id = "BtnPrint", Icon = "icon-file-pdf", Text = this.Dictionary["Common_PrintPdf"], Action = "success" }); 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"] }); this.formFooterActions = new FormFooter(); this.formFooterActions.AddButton(new UIButton { Id = "BtnSave2", Icon = "icon-ok", Action = "success", Text = this.Dictionary["Common_Accept"] }); this.formFooterActions.AddButton(new UIButton { Id = "BtnCancel2", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); if (this.OportunityId != -1) { this.Oportunity = Oportunity.ById(this.OportunityId, this.Company.Id); this.IncidentAction = IncidentAction.ByOportunityId(this.Oportunity.Id, this.Company.Id); if (this.Oportunity.CompanyId != this.Company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); this.Oportunity = Oportunity.Empty; } this.formFooter.ModifiedBy = this.Oportunity.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Oportunity.ModifiedOn; label = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.Dictionary["Item_Oportunity"], this.Oportunity.Description); this.master.TitleInvariant = true; this.master.Titulo = label; } else { this.master.Titulo = this.Dictionary["Item_Oportunity_Detail"]; this.master.TitleInvariant = true; this.Oportunity = Oportunity.Empty; this.IncidentAction = IncidentAction.Empty; } this.RenderProcess(); this.RenderLimit(); this.RenderProbabilitySeverity(); this.RenderActionsForm(); this.RenderActionHistory(); this.RenderDocuments(); this.tabBar.AddTab(new Tab { Id = "home", Selected = true, Active = true, Label = this.Dictionary["Item_Oportunity_Tab_Basic"], Available = true }); this.tabBar.AddTab(new Tab { Id = "accion", Available = this.ApplicationUser.HasGrantToRead(ApplicationGrant.IncidentActions), Active = true, Label = this.Dictionary["Item_Oportunity_Tab_Action"], Hidden = true }); this.tabBar.AddTab(new Tab { Id = "costes", Available = this.ApplicationUser.HasGrantToRead(ApplicationGrant.IncidentActions) && this.ApplicationUser.HasGrantToRead(ApplicationGrant.Cost), Active = true, Label = this.Dictionary["Item_Oportunity_Tab_Costs"], Hidden = true }); this.tabBar.AddTab(new Tab { Id = "graphic", Available = true, Active = true, Label = this.Dictionary["Item_Oportunity_Tab_Graphics"], Hidden = true }); this.tabBar.AddTab(new Tab { Id = "historyActions", Available = this.ApplicationUser.HasGrantToRead(ApplicationGrant.IncidentActions), Active = historyActionActive == true, Label = this.Dictionary["Item_Oportunity_Tab_HistoryActions"], Hidden = !historyActionActive }); this.tabBar.AddTab(new Tab { Id = "uploadFiles", Available = true, Active = true, Label = this.Dictionary["Item_Oportunity_Tab_UploadFiles"], Hidden = this.Oportunity.Id < 1 }); }
/// <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() { if (this.Request.QueryString["id"] != null) { this.IncidentId = Convert.ToInt64(this.Request.QueryString["id"]); } if (this.Request.QueryString["New"] != null) { this.ReturnScript = "document.location = 'IncidentList.aspx';"; } else { this.ReturnScript = "document.location = referrer;"; } this.formFooter = new FormFooter(); this.formFooterAction = new FormFooter(); this.ApplicationUser = (ApplicationUser)Session["User"]; this.company = (Company)Session["company"]; 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_Incidents", "IncidentList.aspx", Constant.NotLeaft); this.master.AddBreadCrumb("Item_Incident_Detail"); this.grantToWrite = this.ApplicationUser.HasGrantToWrite(ApplicationGrant.Incident); if (this.IncidentId > 0) { this.Incident = Incident.GetById(this.IncidentId, this.company.Id); if (this.Incident.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); this.Incident = Incident.Empty; } this.master.TitleInvariant = true; this.master.Titulo = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{2} - {1}</strong>", this.Dictionary["Item_Incident"], this.Incident.Description, this.Incident.Code.ToString()); this.formFooter.ModifiedBy = this.Incident.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Incident.ModifiedOn; 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 = "BtnRestaurar", Icon = "icon-undo", Text = this.Dictionary["Item_Incident_Btn_Restaurar"], Action = "primary", Hidden = !this.Incident.ClosedOn.HasValue }); this.formFooter.AddButton(new UIButton { Id = "BtnAnular", Icon = "icon-ban-circle", Text = this.Dictionary["Item_Incident_Btn_Anular"], Action = "danger", Hidden = this.Incident.ClosedOn.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"] }); this.master.ItemCode = this.Incident.Description; this.IncidentAction = IncidentAction.ByIncidentId(this.IncidentId, this.company.Id); this.formFooterAction.ModifiedBy = this.Incident.ModifiedBy.Description; this.formFooterAction.ModifiedOn = this.Incident.ModifiedOn; this.formFooterAction.AddButton(new UIButton { Id = "BtnRestaurarAction", Icon = "icon-undo", Text = this.Dictionary["Item_Incident_Btn_RestaurarAction"], Action = "primary" }); this.formFooterAction.AddButton(new UIButton { Id = "BtnAnularAction", Icon = "icon-ban-circle", Text = this.Dictionary["Item_Incident_Btn_AnularAction"], Action = "danger" }); this.formFooterAction.AddButton(new UIButton { Id = "BtnSaveAction", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success" }); this.formFooterAction.AddButton(new UIButton { Id = "BtnCancelAction", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); if (this.IncidentAction.Id == 0) { DateTime?today = DateTime.Now.Date; this.IncidentAction.WhatHappened = this.Incident.WhatHappened; this.IncidentAction.WhatHappenedBy = this.Incident.WhatHappenedBy; this.IncidentAction.WhatHappenedOn = this.Incident.WhatHappenedOn == null ? null : today; this.IncidentAction.Causes = this.Incident.Causes; this.IncidentAction.CausesBy = this.Incident.CausesBy; this.IncidentAction.CausesOn = this.Incident.CausesOn == null ? null : today; this.IncidentAction.Actions = this.Incident.Actions; this.IncidentAction.ActionsBy = this.Incident.ActionsBy; this.IncidentAction.ActionsOn = this.IncidentAction.ActionsOn == null ? null : today; this.IncidentAction.ClosedBy = this.Incident.ClosedBy; this.IncidentAction.ClosedOn = this.Incident.ClosedOn == null ? null : today; } this.RenderDocuments(); } else { this.master.Titulo = "Item_Incident_Detail"; this.Incident = Incident.Empty; this.IncidentAction = IncidentAction.Empty; this.formFooter.ModifiedBy = this.Dictionary["Common_New"]; this.formFooter.ModifiedOn = DateTime.Now; 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.formFooter.ModifiedBy = this.Dictionary["Common_New"]; this.formFooter.ModifiedOn = DateTime.Now; this.formFooterAction.AddButton(new UIButton { Id = "BtnSaveAction", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success" }); this.formFooterAction.AddButton(new UIButton { Id = "BtnCancelAction", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); } this.tabBar.AddTab(new Tab { Id = "home", Selected = true, Active = true, Label = this.Dictionary["Item_Incident_Tab_Basic"], Available = true }); this.tabBar.AddTab(new Tab { Id = "accion", Available = this.ApplicationUser.HasGrantToRead(ApplicationGrant.IncidentActions), Active = true, Hidden = this.IncidentId < 1, Label = this.Dictionary["Item_Incident_Tab_Action"] }); this.tabBar.AddTab(new Tab { Id = "costes", Available = this.ApplicationUser.HasGrantToRead(ApplicationGrant.Cost) && this.IncidentId > 0, Hidden = this.IncidentId < 1, Active = this.IncidentId > 0, Label = this.Dictionary["Item_Incident_Tab_Costs"] }); this.tabBar.AddTab(new Tab { Id = "uploadFiles", Available = true, Active = this.IncidentId > 0, Hidden = this.IncidentId < 1, Label = this.Dictionary["Item_Incident_Tab_UploadFiles"] }); //// this.tabBar.AddTab(new Tab { Id = "trazas", Available = this.user.HasGrantToRead(ApplicationGrant.Trace) && this.IncidentId > 0, Active = this.IncidentId > 0, Label = this.dictionary["Item_Incident_Tab_Traces"] }); this.RenderForm(); this.RenderActionForm(); this.ProviderBarPopups = new BarPopup() { Id = "Provider", DeleteMessage = this.Dictionary["Common_DeleteMessage"], BarWidth = 600, UpdateWidth = 600, DeleteWidth = 600, Required = true, RequiredMessage = this.Dictionary["Common_Required"], Duplicated = true, DuplicatedMessage = this.Dictionary["Common_Error_NameAlreadyExists"], Description = "Proveedor", FieldName = this.Dictionary["Common_Name"], BarTitle = this.Dictionary["Item_Providers"] }; this.CustomerBarPopups = new BarPopup() { Id = "Customer", DeleteMessage = this.Dictionary["Common_DeleteMessage"], BarWidth = 600, UpdateWidth = 600, DeleteWidth = 600, Required = true, RequiredMessage = this.Dictionary["Common_Required"], Duplicated = true, DuplicatedMessage = this.Dictionary["Common_Error_NameAlreadyExists"], Description = "Cliente", FieldName = this.Dictionary["Common_Name"], BarTitle = this.Dictionary["Item_Customers"] }; }
/// <summary>Page's load event</summary> /// <param name="sender">Loaded page</param> /// <param name="e">Event arguments</param> protected void Page_Load(object sender, EventArgs e) { this.user = Session["User"] as ApplicationUser; this.company = Session["company"] as Company; //this.user = ApplicationUser.GetById(this.user.Id); if (user.HorarioLunes == null) { user.HorarioLunes = string.Empty; } if (user.HorarioMartes == null) { user.HorarioMartes = string.Empty; } if (user.HorarioMiercoles == null) { user.HorarioMiercoles = string.Empty; } if (user.HorarioJueves == null) { user.HorarioJueves = string.Empty; } if (user.HorarioViernes == null) { user.HorarioViernes = string.Empty; } if (user.HorarioSabado == null) { user.HorarioSabado = string.Empty; } if (user.HorarioDomingo == null) { user.HorarioDomingo = string.Empty; } if (!user.HorarioLunes.Contains("-")) { this.user.HorarioLunes += "-"; } if (!user.HorarioMartes.Contains("-")) { this.user.HorarioMartes += "-"; } if (!user.HorarioMiercoles.Contains("-")) { this.user.HorarioMiercoles += "-"; } if (!user.HorarioJueves.Contains("-")) { this.user.HorarioJueves += "-"; } if (!user.HorarioViernes.Contains("-")) { this.user.HorarioViernes += "-"; } if (!user.HorarioSabado.Contains("-")) { this.user.HorarioSabado += "-"; } if (!user.HorarioDomingo.Contains("-")) { this.user.HorarioDomingo += "-"; } //this.user.Employee = new Employee(this.user.Employee.Id, false); this.dictionary = Session["Dictionary"] as Dictionary <string, string>; this.master = this.Master as Main; this.master.AddBreadCrumbInvariant(this.Dictionary["Item_UserProfile_Breacrumb"]); this.master.Titulo = this.user.Nombre + " - " + this.user.Code; this.master.TitleInvariant = true; this.formFooter = new FormFooter(); this.formFooter.AddButton(new UIButton { Id = "BtnSave", Text = this.dictionary["Common_Accept"], Icon = "icon-ok", Action = "success" }); this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Text = this.dictionary["Common_Cancel"], Icon = "icon-undo" }); }
private void Go() { if (this.Request.QueryString["id"] != null) { this.objetivoId = Convert.ToInt32(this.Request.QueryString["id"]); } if (this.Request.QueryString["New"] != null) { this.ReturnScript = "document.location = 'ObjetivoList.aspx';"; } else { this.ReturnScript = "document.location = referrer;"; } this.ApplicationUser = (ApplicationUser)Session["User"]; this.Company = (Company)Session["company"]; 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_Objetivos", "ObjetivoList.aspx", Constant.NotLeaft); this.master.AddBreadCrumb("Item_Objetivo_Detail"); this.master.Titulo = "Item_Objetivo_Detail"; this.formFooter = new FormFooter(); this.ActionsOpen = 0; if (this.objetivoId > 0) { this.Session["EquipmentId"] = this.objetivoId; this.Objetivo = Objetivo.ById(this.objetivoId, this.Company.Id); if (this.Objetivo.CompanyId != this.Company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.NotLeaft); Context.ApplicationInstance.CompleteRequest(); this.Objetivo = Objetivo.Empty; } this.master.TitleInvariant = true; this.master.Titulo = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.Dictionary["Item_Objetivo_Header_Name"], this.Objetivo.Name); this.formFooter.ModifiedBy = this.Objetivo.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Objetivo.ModifiedOn; this.formFooter.AddButton(new UIButton { Id = "BtnPrint", Icon = "icon-file-pdf", Text = this.Dictionary["Common_PrintPdf"], Action = "success" }); this.formFooter.AddButton(new UIButton { Id = "BtnRestaurar", Icon = "icon-undo", Text = this.Dictionary["Item_Objetivo_Btn_Restaurar"], Action = "primary" }); this.formFooter.AddButton(new UIButton { Id = "BtnAnular", Icon = "icon-ban-circle", Text = this.Dictionary["Item_Objetivo_Btn_Anular"], Action = "danger" }); this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Text = this.Dictionary["Common_Save"], Action = "success" }); } else { //this.master.AddBreadCrumb("Item_Objetivo"); this.master.Titulo = "Item_Objetivo_Detail"; this.Objetivo = Objetivo.Empty; this.formFooter.ModifiedBy = this.Dictionary["Common_New"]; this.formFooter.ModifiedOn = DateTime.Now; 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.tabBar.AddTab(new Tab { Id = "home", Selected = true, Active = true, Label = this.Dictionary["Item_Objetivo_TabBasic"], Available = true }); this.tabBar.AddTab(new Tab { Id = "actions", Available = this.objetivoId > 0 && this.ApplicationUser.HasGrantToRead(ApplicationGrant.IncidentActions), Active = this.objetivoId > 0, Hidden = this.objetivoId < 1, Label = this.Dictionary["Item_Objetivo_TabActions"] }); this.tabBar.AddTab(new Tab { Id = "records", Available = this.objetivoId > 0, Active = this.objetivoId > 0, Hidden = this.objetivoId < 1, Label = this.Dictionary["Item_Objetivo_Tab_Records"] }); this.tabBar.AddTab(new Tab { Id = "graphics", Available = this.objetivoId > 0, Active = this.objetivoId > 0, Hidden = this.objetivoId < 1, Label = this.Dictionary["Item_Objetivo_TabGraphics"] }); this.tabBar.AddTab(new Tab { Id = "historic", Available = this.objetivoId > 0 && this.ApplicationUser.HasGrantToRead(ApplicationGrant.IncidentActions), Active = this.objetivoId > 0, Hidden = this.objetivoId < 1, Label = this.Dictionary["Item_Objetivo_TabHistoric"] }); this.RenderForm(); }
/// <summary>Begin page running after session validations</summary> private void Go() { this.TabTrazas.Visible = ((ApplicationUser)Session["user"]).Admin; if (this.Request.QueryString["id"] != null) { this.userItemId = Convert.ToInt32(this.Request.QueryString["id"]); } if (this.Request.QueryString["New"] != null) { this.returnScript = "document.location = 'UsersList.aspx';"; } else { this.returnScript = "document.location = referrer;"; } this.formFooter = new FormFooter(); this.formFooterLearning = new FormFooter(); this.user = Session["User"] as ApplicationUser; this.company = Session["company"] as Company; 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_Users", "UserList.aspx", Constant.NotLeaft); this.master.AddBreadCrumb("Item_User_Title_Add"); this.master.Titulo = "Item_User_Title_Add"; if (this.userItemId > 0) { this.userItem = ApplicationUser.GetById(this.userItemId, this.company.Id); this.master.TitleInvariant = true; this.master.Titulo = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.Dictionary["Item_User"], this.userItem.UserName); this.formFooter.ModifiedBy = string.Empty; this.formFooter.ModifiedOn = DateTime.Now.Date; string grants = "|"; var grantsException = new List <int> { 1, 2, 6, 26 }; var res = new StringBuilder(); var permisos = this.userItem.EffectiveGrants.OrderBy(o => o.Item.Description).ToList(); foreach (var grant in permisos.Where(g => !grantsException.Contains(g.Item.Code)).OrderBy(gr => gr.Item.Description)) { res.Append(grant.Render()); if (grant.GrantToRead) { grants += string.Format(CultureInfo.InvariantCulture, "R{0}|", grant.Item.Code); } if (grant.GrantToWrite) { grants += string.Format(CultureInfo.InvariantCulture, "W{0}|", grant.Item.Code); } this.Grants.InnerText = grants; } this.GrantsList = res.ToString(); this.LtIdiomas.Text = "<option value=\"es\"" + (this.userItem.Language == "es" ? " selected=\"selected\"" : string.Empty) + ">Castellano</option>"; this.LtIdiomas.Text += "<option value=\"ca\"" + (this.userItem.Language == "ca" ? " selected=\"selected\"" : string.Empty) + ">Català</option>"; this.LtIdiomas.Text += "<option value=\"en\"" + (this.userItem.Language == "en" ? " selected=\"selected\"" : string.Empty) + ">English</option>"; } else { this.userItem = ApplicationUser.Empty; string grants = "|"; var res = new StringBuilder(); var permisos = this.user.EffectiveGrants.OrderBy(o => o.Item.Description).ToList(); foreach (var grant in permisos) { grant.GrantToDelete = false; grant.GrantToRead = false; grant.GrantToWrite = false; res.Append(grant.Render()); if (grant.GrantToRead) { grants += string.Format(CultureInfo.InvariantCulture, "R{0}|", grant.Item.Code); } if (grant.GrantToWrite) { grants += string.Format(CultureInfo.InvariantCulture, "W{0}|", grant.Item.Code); } this.Grants.InnerText = grants; } //this.LtGrantList.Text = res.ToString(); this.LtIdiomas.Text = "<option value=\"es\"" + (this.company.Language == "es" ? " selected=\"selected\"" : string.Empty) + ">Castellano</option>"; this.LtIdiomas.Text += "<option value=\"es\"" + (this.company.Language == "es" ? " selected=\"selected\"" : string.Empty) + ">Castellano</option>"; this.LtIdiomas.Text += "<option value=\"ca\"" + (this.company.Language == "ca" ? " selected=\"selected\"" : string.Empty) + ">Català</option>"; this.LtIdiomas.Text += "<option value=\"en\"" + (this.userItem.Language == "en" ? " selected=\"selected\"" : string.Empty) + ">English</option>"; } 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}"",""UserId"":{1}}}", userName.Key, userName.Value)); } 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"] }); this.RenderCmbEmployeeData(); }
/// <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() { if (this.Request.QueryString["id"] != null) { this.IncidentActionId = Convert.ToInt64(this.Request.QueryString["id"]); } if (this.Request.QueryString["New"] != null) { this.returnScript = "document.location = 'ActionsList.aspx';"; } else { this.returnScript = "document.location = referrer;"; } this.ApplicationUser = Session["User"] as ApplicationUser; this.Company = Session["company"] as Company; 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); if (this.ApplicationUser.HasGrantToRead(ApplicationGrant.IncidentActions)) { this.master.AddBreadCrumb("Item_IncidentActions", "ActionList.aspx", Constant.NotLeaft); } else { this.master.AddBreadCrumb("Item_IncidentActions"); } this.master.AddBreadCrumb("Item_IncidentActions_Detail"); this.grantToWrite = this.ApplicationUser.HasGrantToWrite(ApplicationGrant.IncidentActions); this.Incident = Incident.Empty; if (this.IncidentActionId > 0) { this.IncidentAction = IncidentAction.ById(this.IncidentActionId, this.Company.Id); if (this.IncidentAction.CompanyId != this.Company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); this.IncidentAction = IncidentAction.Empty; } this.master.TitleInvariant = true; this.master.Titulo = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{2} - {1}</strong>", this.Dictionary["Item_IncidentAction"], this.IncidentAction.Description, this.IncidentAction.Number.ToString()); this.formFooter = new FormFooter { ModifiedBy = this.IncidentAction.ModifiedBy.Description, ModifiedOn = this.IncidentAction.ModifiedOn }; this.formFooter.AddButton(new UIButton { Id = "BtnRestaurar", Icon = "icon-undo", Text = this.Dictionary["Item_IncidentAction_Btn_Restaurar"], Action = "primary" }); this.formFooter.AddButton(new UIButton { Id = "BtnAnular", Icon = "icon-ban-circle", Text = this.Dictionary["Item_IncidentAction_Btn_Anular"], Action = "danger" }); 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", ColumnsSpan = 12 }); this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"], ColumnsSpan = 12 }); this.master.ItemCode = this.IncidentAction.Description; this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin2"]; if (this.IncidentAction.IncidentId.HasValue && this.IncidentAction.IncidentId > 0) { this.Incident = Incident.GetById(this.IncidentAction.IncidentId.Value, this.Company.Id); this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin3"] + " " + this.Incident.Link; } if (this.IncidentAction.BusinessRiskId.HasValue && this.IncidentAction.BusinessRiskId > 0) { this.BusinessRisk = BusinessRisk.ById(this.Company.Id, this.IncidentAction.BusinessRiskId.Value); this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin4"] + " " + this.BusinessRisk.Link; } if (this.IncidentAction.Objetivo.Id > 0) { this.Objetivo = this.IncidentAction.Objetivo; this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin5"] + " " + this.Objetivo.Link; } if (this.IncidentAction.Oportunity.Id > 0) { this.Oportunity = this.IncidentAction.Oportunity; this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin6"] + " " + this.Oportunity.Link; } if (this.IncidentAction.Origin == 1) { if (this.IncidentAction.AuditoryId != null && this.IncidentAction.AuditoryId > 0) { var auditory = Auditory.ById(this.IncidentAction.AuditoryId.Value, this.Company.Id); this.OriginItemLink = string.Format( CultureInfo.InvariantCulture, @"{0} - {1}", this.Dictionary["Item_IncidentAction_Origin1"], auditory.Link); } else { this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin1"]; } } this.RenderDocuments(); } else { this.master.Titulo = "Item_IncidentActions_Detail"; this.IncidentAction = IncidentAction.Empty; this.formFooter = new FormFooter(this.Dictionary, this.grantToWrite); if (this.Request.QueryString["o"] != null) { var objetivoId = Convert.ToInt32(this.Request.QueryString["o"]); this.Objetivo = Objetivo.ById(objetivoId, this.Company.Id); this.IncidentAction.Description = this.Objetivo.Name; this.IncidentAction.Origin = 5; this.IncidentAction.Objetivo = this.Objetivo; this.IncidentAction.WhatHappened = this.Objetivo.Description; this.IncidentAction.WhatHappenedOn = DateTime.Now; } this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin2"]; if (this.IncidentAction.Origin == 1) { this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin1"]; } else if (this.IncidentAction.Origin == 5) { this.OriginItemLink = string.Format( CultureInfo.InvariantCulture, "{0}: {1}", this.Dictionary["Item_IncidentAction_Origin5"], this.Objetivo.Link); } } this.tabBar.AddTab(new Tab { Id = "home", Selected = true, Active = true, Label = this.Dictionary["Item_IncidentAction_Tab_Basic"], Available = true }); this.tabBar.AddTab(new Tab { Id = "costes", Available = this.ApplicationUser.HasGrantToRead(ApplicationGrant.Cost) && this.IncidentActionId > 0, Active = this.IncidentActionId > 0, Label = this.Dictionary["Item_IncidentAction_Tab_Costs"] }); this.tabBar.AddTab(new Tab { Id = "uploadFiles", Available = true, Active = this.IncidentActionId > 0, Hidden = this.IncidentActionId < 1, Label = this.Dictionary["Item_IncidentAction_Tab_UploadFiles"] }); // this.tabBar.AddTab(new Tab { Id = "trazas", Available = this.user.HasTraceGrant() && this.IncidentActionId > 0, Active = this.IncidentActionId > 0, Label = this.dictionary["Item_IncidentAction_Tab_Traces"] }); this.RenderForm(); this.ProviderBarPopups = new BarPopup { Id = "Provider", DeleteMessage = this.Dictionary["Common_DeleteMessage"], BarWidth = 600, UpdateWidth = 600, DeleteWidth = 600, Required = true, RequiredMessage = this.Dictionary["Common_Required"], Duplicated = true, DuplicatedMessage = this.Dictionary["Common_Error_NameAlreadyExists"], Description = "Proveedor", FieldName = this.Dictionary["Item_Provider"], BarTitle = this.Dictionary["Item_Providers"] }; this.CustomerBarPopups = new BarPopup { Id = "Customer", DeleteMessage = this.Dictionary["Common_DeleteMessage"], BarWidth = 600, UpdateWidth = 600, DeleteWidth = 600, Required = true, RequiredMessage = this.Dictionary["Common_Required"], Duplicated = true, DuplicatedMessage = this.Dictionary["Common_Error_NameAlreadyExists"], Description = "Cliente", FieldName = this.Dictionary["Item_Customer"], BarTitle = this.Dictionary["Item_Customers"] }; }
/// <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.Action = "Baja"; if (this.Request.QueryString["id"] != null) { this.EmployeeId = Convert.ToInt32(this.Request.QueryString["id"].ToString()); } if (this.Request.QueryString["enddate"] != null) { this.EndDate = this.Request.QueryString["enddate"].ToString().Trim(); } if (this.Request.QueryString["action"] != null) { var actionData = this.Request.QueryString["action"].ToString().Trim(); if (actionData == "delete") { this.Action = "delete"; } } this.user = Session["User"] as ApplicationUser; this.company = Session["company"] as Company; this.Dictionary = Session["Dictionary"] as Dictionary <string, string>; string label = "Item_Employee_Title_Delete"; 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(label); this.master.Titulo = this.Dictionary["Item_Employee"]; this.formFooter = new FormFooter(); if (this.EmployeeId > 0) { this.Employee = new Employee(this.EmployeeId, true); if (this.Employee.CompanyId != this.company.Id) { this.Response.Redirect("NoAccesible.aspx", false); Context.ApplicationInstance.CompleteRequest(); } label = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.Dictionary["Item_Employee"], this.Employee.FullName); this.master.TitleInvariant = true; this.master.Titulo = label; this.tabBar.AddTab(new Tab { Id = "home", Selected = true, Active = true, Label = this.Dictionary["Item_Employee_Tab_Delete"], Available = true }); this.formFooter.AddButton(new UIButton() { Id = "BtnSave", Icon = "icon-ban-circle", Text = this.Dictionary["Item_Employee_Btn_Inactive"], Action = "danger" }); this.formFooter.AddButton(new UIButton() { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); this.formFooter.ModifiedBy = this.Employee.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Employee.ModifiedOn; this.TxtEndDate = new FormDatePicker() { Id = "TxtEndDate", Label = this.Dictionary["Item_Employee_FieldLabel_InactiveDate"], ColumnsSpanLabel = Constant.ColumnSpan2, ColumnsSpan = Constant.ColumnSpan2, Required = true, Value = DateTime.Now }; } }