コード例 #1
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            // Set active toolbar
            mForm6 master = (mForm6)this.Master;
            master.ActiveToolbar = "Resources";

            // Cost information only visible for admin
            tpGeneralData.Visible = true;

            if (!Convert.ToBoolean(Session["sgLFS_RESOURCES_EMPLOYEES_ADMIN"]))
            {
                tpGeneralData.Visible = false;
                tkrpbLeftMenuTools.Items[0].Items[0].Visible = false; // Personnel Agencies
            }

            if (!(Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_VACATIONS_HOLIDAY_FULL_EDITING"])))
            {
                tkrpbLeftMenuTools.Items[0].Items[1].Visible = false; // Vacations Setup
            }

            // For vacation error message
            EmployeeInformationPayVacationDaysInformationList employeeInformationPayVacationDaysInformationList = new EmployeeInformationPayVacationDaysInformationList();
            employeeInformationPayVacationDaysInformationList.LoadByEmployeeId(Int32.Parse(hdfCurrentEmployeeId.Value));

            if (employeeInformationPayVacationDaysInformationList.Table.Rows.Count < 1)
            {
                lblNoExistVacations.Visible = true;
            }

            // For job costing error message
            int employeeId = Int32.Parse(hdfCurrentEmployeeId.Value);
            EmployeeInformationBasicInformationGateway employeeInformationBasicInformationGateway = new EmployeeInformationBasicInformationGateway(employeeInformationTDS);
            decimal? bourdenFactor = employeeInformationBasicInformationGateway.GetBourdenFactor(employeeId);
            decimal? usHealthBenefitFactor = employeeInformationBasicInformationGateway.GetUSHealthBenefitFactor(employeeId);
            decimal? benefitFactorCad = employeeInformationBasicInformationGateway.GetBenefitFactorCad(employeeId);
            decimal? benefitFactorUsd = employeeInformationBasicInformationGateway.GetBenefitFactorUsd(employeeId);

            if ((!bourdenFactor.HasValue) || (!usHealthBenefitFactor.HasValue) || (!benefitFactorCad.HasValue) || (!benefitFactorUsd.HasValue))
            {
                lblJoxCostingFactorsError.Visible = true;
            }
        }
コード例 #2
0
        private void LoadBasicData(int employeeId)
        {
            EmployeeInformationBasicInformationGateway employeeInformationBasicInformationGateway = new EmployeeInformationBasicInformationGateway(employeeInformationTDS);
            if (employeeInformationBasicInformationGateway.Table.Rows.Count > 0)
            {
                // Load employee basic data
                tbxFisrtName.Text = employeeInformationBasicInformationGateway.GetFirstName(employeeId);
                tbxLastName.Text = employeeInformationBasicInformationGateway.GetLastName(employeeId);
                tbxeMail.Text = employeeInformationBasicInformationGateway.GeteMail(employeeId);
                ckbxIsSalesman.Checked = employeeInformationBasicInformationGateway.GetIsSalesman(employeeId);
                ckbxRequestTimesheet.Checked = employeeInformationBasicInformationGateway.GetRequestProjectTime(employeeId);
                ckbxSalaried.Checked = employeeInformationBasicInformationGateway.GetSalaried(employeeId);
                ckbxAssignableSrs.Checked = employeeInformationBasicInformationGateway.GetAssignableSRS(employeeId);
                tbxJobClassType.Text = employeeInformationBasicInformationGateway.GetJobClassType(employeeId);
                tbxCategory.Text = employeeInformationBasicInformationGateway.GetCategory(employeeId);
                tbxPersonalAgency.Text = employeeInformationBasicInformationGateway.GetPersonalAgencyName(employeeId);
                ckbxVacationsManager.Checked = employeeInformationBasicInformationGateway.GetIsVacationsManager(employeeId);
                ckbxApproveTimesheets.Checked = employeeInformationBasicInformationGateway.GetApproveTimesheets(employeeId);
                tbxCrew.Text = employeeInformationBasicInformationGateway.GetCrew(employeeId);

                string type = employeeInformationBasicInformationGateway.GetType(employeeId);
                EmployeeTypeGateway employeeTypeGateway = new EmployeeTypeGateway();
                employeeTypeGateway.LoadByType(type);
                tbxType.Text = employeeTypeGateway.GetDescription(type);

                string state = employeeInformationBasicInformationGateway.GetState(employeeId);
                EmployeeStateGateway employeeStateGateway = new EmployeeStateGateway();
                employeeStateGateway.LoadByState(state);
                tbxState.Text = employeeStateGateway.GetDescription(state);

                // Job costing factors
                decimal? bourdenFactor = employeeInformationBasicInformationGateway.GetBourdenFactor(employeeId);
                if (bourdenFactor.HasValue)
                {
                    tbxBourdenFactor.Text = decimal.Round((decimal)bourdenFactor,1).ToString();
                }

                decimal? usHealthBenefitFactor = employeeInformationBasicInformationGateway.GetUSHealthBenefitFactor(employeeId);
                if (usHealthBenefitFactor.HasValue)
                {
                    tbxUSHealthBenefitFactor.Text = decimal.Round((decimal)usHealthBenefitFactor, 1).ToString();
                }

                decimal? benefitFactorCad = employeeInformationBasicInformationGateway.GetBenefitFactorCad(employeeId);
                if (benefitFactorCad.HasValue)
                {
                    tbxBenefitFactorCad.Text = decimal.Round((decimal)benefitFactorCad, 2).ToString();
                }

                decimal? benefitFactorUsd = employeeInformationBasicInformationGateway.GetBenefitFactorUsd(employeeId);
                if (benefitFactorUsd.HasValue)
                {
                    tbxBenefitFactorUsd.Text = decimal.Round((decimal)benefitFactorUsd, 2).ToString();
                }
            }
        }
コード例 #3
0
        private void LoadBasicData(int employeeId)
        {
            // Load Data
            EmployeeInformationBasicInformationGateway employeeInformationBasicInformationGateway = new EmployeeInformationBasicInformationGateway(employeeInformationTDS);
            if (employeeInformationBasicInformationGateway.Table.Rows.Count > 0)
            {
                // Load employee basic data
                tbxFisrtName.Text = employeeInformationBasicInformationGateway.GetFirstName(employeeId);
                tbxLastName.Text = employeeInformationBasicInformationGateway.GetLastName(employeeId);
                tbxeMail.Text = employeeInformationBasicInformationGateway.GeteMail(employeeId);
                ckbxIsSalesman.Checked = employeeInformationBasicInformationGateway.GetIsSalesman(employeeId);
                ckbxRequestTimesheet.Checked = employeeInformationBasicInformationGateway.GetRequestProjectTime(employeeId);
                ckbxSalaried.Checked = employeeInformationBasicInformationGateway.GetSalaried(employeeId);
                ckbxAssignableSrs.Checked = employeeInformationBasicInformationGateway.GetAssignableSRS(employeeId);
                ddlType.SelectedValue = employeeInformationBasicInformationGateway.GetType(employeeId);
                ddlState.SelectedValue = employeeInformationBasicInformationGateway.GetState(employeeId);
                ddlCategory.SelectedValue = employeeInformationBasicInformationGateway.GetCategory(employeeId);
                ddlPersonalAgency.SelectedValue = employeeInformationBasicInformationGateway.GetPersonalAgencyName(employeeId);
                ckbxVacationsManager.Checked = employeeInformationBasicInformationGateway.GetIsVacationsManager(employeeId);
                ckbxApproveTimesheets.Checked = employeeInformationBasicInformationGateway.GetApproveTimesheets(employeeId);
                if (employeeInformationBasicInformationGateway.GetCrew(employeeId) != "")
                {
                    ddlCrew.SelectedValue = employeeInformationBasicInformationGateway.GetCrew(employeeId);
                }
                else
                {
                    ddlCrew.SelectedIndex = 0;
                }

                if (employeeInformationBasicInformationGateway.GetType(employeeId).Contains("CA"))
                {
                    ProjectTimeJobClassTypeList projectTimeJobClassTypeList = new ProjectTimeJobClassTypeList();
                    projectTimeJobClassTypeList.LoadAndAddItem(1, 3, "");
                    ddlJobClassType.DataSource = projectTimeJobClassTypeList.Table;
                    ddlJobClassType.DataValueField = "JobClassType";
                    ddlJobClassType.DataTextField = "JobClassType";
                    ddlJobClassType.DataBind();
                }
                else
                {
                    ProjectTimeJobClassTypeList projectTimeJobClassTypeList = new ProjectTimeJobClassTypeList();
                    projectTimeJobClassTypeList.LoadAndAddItem(2, 3, "");
                    ddlJobClassType.DataSource = projectTimeJobClassTypeList.Table;
                    ddlJobClassType.DataValueField = "JobClassType";
                    ddlJobClassType.DataTextField = "JobClassType";
                    ddlJobClassType.DataBind();
                }

                ddlJobClassType.SelectedValue = employeeInformationBasicInformationGateway.GetJobClassType(employeeId);

                // Job costing factors
                decimal? bourdenFactor = employeeInformationBasicInformationGateway.GetBourdenFactor(employeeId);
                if (bourdenFactor.HasValue)
                {
                    tbxBourdenFactor.Text = decimal.Round((decimal)bourdenFactor, 1).ToString();
                }

                decimal? usHealthBenefitFactor = employeeInformationBasicInformationGateway.GetUSHealthBenefitFactor(employeeId);
                if (usHealthBenefitFactor.HasValue)
                {
                    tbxUSHealthBenefitFactor.Text = decimal.Round((decimal)usHealthBenefitFactor, 1).ToString();
                }

                decimal? benefitFactorCad = employeeInformationBasicInformationGateway.GetBenefitFactorCad(employeeId);
                if (benefitFactorCad.HasValue)
                {
                    tbxBenefitFactorCad.Text = decimal.Round((decimal)benefitFactorCad, 2).ToString();
                }

                decimal? benefitFactorUsd = employeeInformationBasicInformationGateway.GetBenefitFactorUsd(employeeId);
                if (benefitFactorUsd.HasValue)
                {
                    tbxBenefitFactorUsd.Text = decimal.Round((decimal)benefitFactorUsd, 2).ToString();
                }
            }
        }