Exemplo n.º 1
0
        protected void newEducationButton_Click(object sender, EventArgs e)
        {
            GradeEntity grade = new GradeEntity();
            grade.Id = GradeTextBox.Text;
            grade.JobCode = Request.QueryString["jobCode"];
            try
            {
                new GradeMapper().Insert(grade);
                Response.Redirect("DefineGrade.aspx?jobCode=" + Request.QueryString["jobCode"]);
            }
            catch (Exception)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("<script language='javascript'>displayNoty('Please write another Grade name beacuse this Grade name already exists.');</script>");

                // if the script is not already registered
                if (!Page.ClientScript.IsClientScriptBlockRegistered(Page.GetType(), "HeyPopup"))
                    ClientScript.RegisterClientScriptBlock(Page.GetType(), "HeyPopup", sb.ToString());
            }
        }
Exemplo n.º 2
0
        protected void ProceedButton_Click(object sender, EventArgs e)
        {
            JobDetailsSessionView jbs = new JobDetailsSessionView();

            FunctionalLevelEntity flentity = new FunctionalLevelEntity();
            flentity.Id = Convert.ToInt32(FunctionalLevelDropDownList.SelectedValue);
            flentity = new FunctionalLevelMapper().Get(flentity);
            jbs.FunctionalLevel = flentity;

            OrganizationalUnitEntity ouentity = new OrganizationalUnitEntity();
            ouentity.Id = Convert.ToInt32(OrganisationalUnitDropDownList.SelectedValue);
            OrganizationalUnitView ouView = new OrganizationalUnitMapper().Get(ouentity);
            jbs.OrganisationalUnit = ouView;

            GradeEntity gentity = new GradeEntity();
            gentity.Id = GradeDropDownList.SelectedValue;
            gentity = new GradeMapper().Get(gentity);
            jbs.Grade = gentity;

            JobTitleEntity job = new JobTitleEntity();
            job.JobCode = JobDetailsDropDownList.SelectedValue;
            JobTitleView jobview = new JobTitleMapper().Get(job);
            jbs.Job = jobview;

            StepEntity sentity = new StepEntity();
            sentity.Id = StepDropDownList.SelectedValue;
            sentity = new StepMapper().Get(sentity);
            jbs.Step = sentity;

            foreach (ListItem item in ContractsCheckBoxList.Items)
            {
                if (item.Selected == true)
                {
                    jbs.ContractsTemplates.Add(new ContractTemplateEntity() { Id = Convert.ToInt32(item.Value), Title = item.Text });
                }
            }

            Session.Add("JobDetails", jbs);
            Response.Redirect("Contract.aspx?EmployeeId=" + Request.QueryString["EmployeeId"] + "&ContractTemplateId=" + jbs.ContractsTemplates[0].Id);
        }