// /////////////////////////////////////////////////////////////////////////////////////////////////////
        //
        // STEP2 - SUMMARY
        //
        // ////////////////////////////////////////////////////////////////////////
        // STEP2 - SUMMARY - METHODS
        //
        private void StepSummaryIn()
        {
            // Set instruction
            Label instruction = (Label)this.Master.FindControl("lblInstruction");
            instruction.Text = "Summary";

            // Initialize summary
            EmployeeStandardCostsSetupTDS dataSet = new EmployeeStandardCostsSetupTDS();
            dataSet.StandardCostsSetup.Merge(standardCostsSetup, true);
            EmployeeStandardCostsSetup model = new EmployeeStandardCostsSetup(dataSet);

            tbxSummary.Text = model.GetSummary();
        }
        // /////////////////////////////////////////////////////////////////////////////////////////////////////
        //
        // STEP1 - BEGIN
        //
        // ////////////////////////////////////////////////////////////////////////
        // STEP1 - BEGIN - METHODS
        //
        private void StepBeginIn()
        {
            // Set instruction
            Label instruction = (Label)this.Master.FindControl("lblInstruction");
            instruction.Text = "Please provide job costing factors for each employee";

            // Initiaize data
            standardCostsSetup = new EmployeeStandardCostsSetupTDS.StandardCostsSetupDataTable();

            // Load
            EmployeeStandardCostsSetupTDS dataSet = new EmployeeStandardCostsSetupTDS();
            EmployeeStandardCostsSetup model = new EmployeeStandardCostsSetup(dataSet);

            model.LoadAll();

            // Store tables
            standardCostsSetup = (EmployeeStandardCostsSetupTDS.StandardCostsSetupDataTable)model.Table;
            Session["standardCostsSetup"] = standardCostsSetup;
        }
        private void StepBeginProcessGrid()
        {
            if (ExistsDataModified())
            {
                EmployeeStandardCostsSetupTDS dataSet = new EmployeeStandardCostsSetupTDS();
                dataSet.StandardCostsSetup.Merge(standardCostsSetup, true);
                EmployeeStandardCostsSetup model = new EmployeeStandardCostsSetup(dataSet);

                // update rows
                foreach (GridViewRow row in grdCostSetup.Rows)
                {
                    int employeeId = Int32.Parse(grdCostSetup.DataKeys[row.RowIndex].Values["EmployeeID"].ToString());

                    decimal? newBurdenFactor = null;
                    if (((TextBox)row.FindControl("tbxBourdenFactor")).Text != "")
                    {
                        newBurdenFactor = decimal.Round(decimal.Parse(((TextBox)row.FindControl("tbxBourdenFactor")).Text),1);
                    }

                    decimal? newUSHealthBenefitFactor = null;
                    if (((TextBox)row.FindControl("tbxUSHealthBenefitFactor")).Text != "")
                    {
                        newUSHealthBenefitFactor = decimal.Round(decimal.Parse(((TextBox)row.FindControl("tbxUSHealthBenefitFactor")).Text), 1);
                    }

                    decimal? newBenefitFactorCad = null;
                    if (((TextBox)row.FindControl("tbxBenefitFactorCad")).Text != "")
                    {
                        newBenefitFactorCad = decimal.Round(decimal.Parse(((TextBox)row.FindControl("tbxBenefitFactorCad")).Text), 2);
                    }

                    decimal? newBenefitFactorUsd = null;
                    if (((TextBox)row.FindControl("tbxBenefitFactorUsd")).Text != "")
                    {
                        newBenefitFactorUsd = decimal.Round(decimal.Parse(((TextBox)row.FindControl("tbxBenefitFactorUsd")).Text),2);
                    }

                    model.Update(employeeId, newBurdenFactor, newUSHealthBenefitFactor, newBenefitFactorCad, newBenefitFactorUsd);
                }

                standardCostsSetup = (EmployeeStandardCostsSetupTDS.StandardCostsSetupDataTable)model.Table;
                Session["standardCostsSetup"] = standardCostsSetup;

                hdfUpdate.Value = "yes";
            }
        }
        private void Save()
        {
            // process sections
            EmployeeStandardCostsSetupTDS dataSet = new EmployeeStandardCostsSetupTDS();
            dataSet.StandardCostsSetup.Merge(standardCostsSetup, true);
            EmployeeStandardCostsSetup model = new EmployeeStandardCostsSetup(dataSet);

            // save to database
            DB.Open();
            DB.BeginTransaction();
            try
            {
                model.Save(int.Parse(hdfCompanyId.Value));

                DB.CommitTransaction();
            }
            catch (Exception ex)
            {
                DB.RollbackTransaction();

                string url = string.Format("./../../error_page.aspx?error={0}", ex.Message.Replace('\n', ' '));
                Response.Redirect(url);
            }
        }