Ejemplo n.º 1
0
 public void WaitForActivityStatusChange(string activityDisplayName, TestActivityInstanceState targetState, int numOccurences)
 {
     WaitForTrace(new ActivityTrace(activityDisplayName, ActivityTrace.GetActivityInstanceState(targetState)), numOccurences);
 }
Ejemplo n.º 2
0
    /// <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;
    }
Ejemplo n.º 3
0
    /// <summary>Begin page running after session validations</summary>
    private void Go()
    {
        this.CuestionariosCompletos = Constant.JavaScriptFalse;
        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();

        if (this.Auditory.Status > 0)
        {
            this.CuestionariosJson = Auditory.RenderCuestionarios(this.Auditory.Id, this.company.Id);
        }

        this.CuestionariosPreguntas();
        this.RenderBarPopups();
    }
Ejemplo n.º 4
0
    /// <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);
        }
    }