// ///////////////////////////////////////////////////////////////////////////////////////////////////// // // STEP1 - BEGIN // // //////////////////////////////////////////////////////////////////////// // STEP1 - BEGIN - AUXILIAR EVENTS // protected void ddlSelectAPeriod_SelectedIndexChanged(object sender, EventArgs e) { Page.Validate("Begin"); if (Page.IsValid) { StepBeginProcessGrid(); // Load VacationsSetupTDS dataSet = new VacationsSetupTDS(); dataSet.VacationsSetup.Merge(vacationsSetup, true); VacationsSetup model = new VacationsSetup(dataSet); if (dataSet.VacationsSetup.Select(string.Format("Year = {0}", Int32.Parse(ddlSelectAPeriod.SelectedValue))).Length == 0) { // ... Load model.LoadByYear(Int32.Parse(ddlSelectAPeriod.SelectedValue), Int32.Parse(hdfCompanyId.Value)); dataSet.VacationsSetup.Merge(vacationsSetup, true); odsVacationsSetup.FilterExpression = string.Format("Year = {0}", Int32.Parse(ddlSelectAPeriod.SelectedValue)); } else { odsVacationsSetup.FilterExpression = string.Format("Year = {0}", Int32.Parse(ddlSelectAPeriod.SelectedValue)); } // Store tables vacationsSetup = (VacationsSetupTDS.VacationsSetupDataTable)model.Table; Session["vacationsSetup"] = vacationsSetup; } grdVacationsSetup.DataBind(); }
// //////////////////////////////////////////////////////////////////////// // STEP1 - BEGIN - METHODS // private void StepBeginIn() { // Set instruction Label instruction = (Label)this.Master.FindControl("lblInstruction"); instruction.Text = "Please provide paid vacation days information"; // Initiaize data vacationsSetup = new VacationsSetupTDS.VacationsSetupDataTable(); // Load VacationsSetupTDS dataSet = new VacationsSetupTDS(); VacationsSetup model = new VacationsSetup(dataSet); model.LoadByYear(Int32.Parse(ddlSelectAPeriod.SelectedValue), Int32.Parse(hdfCompanyId.Value)); // Store tables vacationsSetup = (VacationsSetupTDS.VacationsSetupDataTable)model.Table; Session["vacationsSetup"] = vacationsSetup; }