コード例 #1
0
        protected string GetType(object type)
        {
            if (type != DBNull.Value)
            {
                EmployeeTypeGateway employeeTypeGateway = new EmployeeTypeGateway();
                employeeTypeGateway.LoadByType((string)type);

                if (employeeTypeGateway.Table.Rows.Count > 0)
                {
                    return employeeTypeGateway.GetDescription((string)type);
                }
                else
                {
                    return "";
                }
            }
            else
            {
                return "";
            }
        }
コード例 #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 string GetSummary()
        {
            string summary = "NEW TEAM MEMBER \n";
            summary = summary + "First Name: " + hdfFirstName.Value + "\n";
            summary = summary + "Last Name: " + hdfLastName.Value + "\n";
            summary = summary + "eMail: " + hdfMail.Value + "\n";

            EmployeeTypeGateway employeeTypeGateway = new EmployeeTypeGateway();
            employeeTypeGateway.LoadByType(hdfType.Value);
            summary = summary + "Type: " + employeeTypeGateway.GetDescription(hdfType.Value) + "\n";

            EmployeeStateGateway employeeStateGateway = new EmployeeStateGateway();
            employeeStateGateway.LoadByState(hdfState.Value);
            summary = summary + "State: " + employeeStateGateway.GetDescription(hdfState.Value) +"\n";

            summary = summary + "Category: " + ddlCategory.SelectedValue + "\n";

            summary = summary + "Job Class: " + ddlJobClassType.SelectedValue + "\n";

            summary = summary + "\n";

            string approveTimesheets = "";
            if (ckbxApproveTimesheets.Checked) approveTimesheets = "Yes"; else approveTimesheets = "No";
            summary = summary + "Approve Timesheets?: " + approveTimesheets + "\n";

            string requestTimesheet = "";
            if (hdfRequestTimesheet.Value == "True") requestTimesheet = "Yes"; else requestTimesheet = "No";
            summary = summary + "Request Timesheet?: " + requestTimesheet + "\n";

            string salaried = "";
            if (hdfSalaried.Value == "True") salaried = "Yes"; else salaried = "No";
            summary = summary + "Salaried: " + salaried + "\n";

            string assignableSrs = "";
            if (hdfAssignableSrs.Value == "True") assignableSrs = "Yes"; else assignableSrs = "No";
            summary = summary + "Assignable SR's: " + assignableSrs + "\n";

            string isVacationsManager = "";
            if (ckbxVacationsManager.Checked) isVacationsManager = "Yes"; else isVacationsManager = "No";
            summary = summary + "Vacations Manager?: " + isVacationsManager + "\n";

            string personalAgency = "";
            if (ddlPersonalAgency.SelectedIndex > 0)
            {
                personalAgency = ddlPersonalAgency.SelectedValue;
            }
            summary = summary + "Personnel Agency: " + personalAgency + "\n";

            return summary;
        }