Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["orgUnitId"] != null)
            {
                if (!IsPostBack)
                {
                    OrganizationalUnitView view = new OrganizationalUnitMapper().Get(new Entities.OrganizationalUnitEntity()
                    {
                        Id = Convert.ToInt32(Request.QueryString["orgUnitId"])
                    });

                    if (view != null)
                    {
                        TitleTextBox.Text     = view.Title;
                        OtherInfoTextBox.Text = view.Description;

                        OrganizationalUnitView orgView = new OrganizationalUnitMapper().GetParent(new Entities.OrganizationalUnitEntity()
                        {
                            Id = Convert.ToInt32(Request.QueryString["orgUnitId"])
                        });
                        ParentCascadingDropDown.ContextKey = orgView.TitleAndOrganizationaUnitGroup;

                        OrganizationalUnitGroupCascadingDropDown.ContextKey = view.OrganizationaUnitGroup;
                    }
                    else
                    {
                        Response.Redirect("List.aspx");
                    }
                }
            }
            else
            {
                Response.Redirect("List.aspx");
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["jobCode"] != null)
            {
                if (!IsPostBack)
                {
                    JobTitleView view = new JobTitleMapper().Get(new JobTitleEntity()
                    {
                        JobCode = Request.QueryString["jobCode"]
                    });
                    if (view.Code != "")
                    {
                        JobCodeCurrentLabel.InnerText = Request.QueryString["jobCode"];
                        JobTitleTextBox.Text          = view.Title;

                        JobTitleView jobView = new JobTitleMapper().GetParent(view.Code);
                        ReportsToCascadingDropDown.ContextKey = jobView.Title;

                        OrganizationalUnitView orgView = new OrganizationalUnitMapper().Get(view.OrganisationalUnit);
                        OrganizationalUnitCascadingDropDown.ContextKey = orgView.TitleAndOrganizationaUnitGroup;
                    }
                    else
                    {
                        Response.Redirect("List.aspx");
                    }
                }
            }
            else
            {
                Response.Redirect("List.aspx");
            }
        }
Exemple #3
0
        public static List <G_JSTree> GetAllNodes(string id, string isOrganizationUnit, string contractTemplateId)
        {
            List <G_JSTree> list = new List <G_JSTree>();

            if (isOrganizationUnit == "False")
            {
                return(list);
            }

            if (id == "0")
            {
                List <OrganizationalUnitView> organizationalUnits = new OrganizationalUnitMapper().List("");
                foreach (OrganizationalUnitView organizationalUnit in organizationalUnits)
                {
                    G_JSTree parent = new G_JSTree();
                    parent.data        = organizationalUnit.Title;
                    parent.state       = "closed";
                    parent.IdServerUse = 10;
                    parent.attr        = new G_JsTreeAttribute {
                        id = "0" + organizationalUnit.Id.ToString(), selected = false, isOrganizationUnit = true
                    };

                    list.Add(parent);
                }
            }
            else
            {
                List <EmployeeView> employees = new List <EmployeeView>();
                if (contractTemplateId != "0")
                {
                    employees = new EmployeeMapper().ListWithAdvancedFilterByContractPreffix("", "", "", Convert.ToInt32(id), "", StatusEnum.Active, Convert.ToInt32(contractTemplateId));
                }
                else
                {
                    employees = new EmployeeMapper().ListWithAdvancedFilterByContractPreffix("", "", "", Convert.ToInt32(id), "", StatusEnum.Active, null);
                }
                foreach (EmployeeView employee in employees)
                {
                    G_JSTree child = new G_JSTree();
                    child.data        = employee.ToString();
                    child.state       = "closed";
                    child.IdServerUse = 10;
                    child.children    = null;
                    child.attr        = new G_JsTreeAttribute {
                        id = employee.Id.ToString(), selected = false, isOrganizationUnit = false
                    };
                    list.Add(child);
                }
            }

            return(list);
        }
Exemple #4
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);
        }
        public CascadingDropDownNameValue[] GetOrganizationalUnits(string knownCategoryValues, string category, string contextKey)
        {
            List <CascadingDropDownNameValue> values = new List <CascadingDropDownNameValue>();

            List <OrganizationalUnitView> list = new OrganizationalUnitMapper().List("");

            foreach (OrganizationalUnitView ent in list)
            {
                CascadingDropDownNameValue cdnv;
                if (ent.TitleAndOrganizationaUnitGroup == contextKey)
                {
                    cdnv = new CascadingDropDownNameValue(ent.TitleAndOrganizationaUnitGroup, ent.Id.ToString(), true);
                }
                else
                {
                    cdnv = new CascadingDropDownNameValue(ent.TitleAndOrganizationaUnitGroup, ent.Id.ToString());
                }

                values.Add(cdnv);
            }

            return(values.ToArray());
        }