// //////////////////////////////////////////////////////////////////////// // EVENTS // protected void Page_Load(object sender, EventArgs e) { // Register client scripts this.RegisterClientScripts(); if (!IsPostBack) { // Security check if (!(Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_UNITS_VIEW"]) && Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_UNITS_EDIT"]))) { Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator."); } // Validate query string if (((string)Request.QueryString["source_page"] == null) || ((string)Request.QueryString["unit_id"] == null) || ((string)Request.QueryString["unit_type"] == null) || ((string)Request.QueryString["unit_state"] == null) || ((string)Request.QueryString["active_tab"] == null)) { Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in units_state.aspx"); } // Tag Page hdfUnitId.Value = Request.QueryString["unit_id"].ToString(); hdfUnitType.Value = Request.QueryString["unit_type"].ToString(); hdfActiveTab.Value = Request.QueryString["active_tab"].ToString(); hdfUnitState.Value = Request.QueryString["unit_state"].ToString(); hdfNewUnitState.Value = Request.QueryString["new_unit_state"].ToString(); hdfCompanyId.Value = Session["companyID"].ToString(); // If coming from units_summary.aspx if ((string)Request.QueryString["source_page"] == "units_summary.aspx") { // Store Navigator State and Update control StoreNavigatorState(); ViewState["update"] = Request.QueryString["update"]; int companyId = Int32.Parse(hdfCompanyId.Value.Trim()); int unitId = Int32.Parse(hdfUnitId.Value.Trim()); unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; UnitInformationUnitDetails unitInformationUnitDetails = new UnitInformationUnitDetails(unitInformationTDS); unitInformationUnitDetails.LoadByUnitId(unitId, companyId); // Store dataset Session["unitInformationTDS"] = unitInformationTDS; } // Restore dataset unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; } else { // Restore dataset unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; } }
// //////////////////////////////////////////////////////////////////////// // EVENTS // protected void Page_Load(object sender, EventArgs e) { // Register client scripts this.RegisterClientScripts(); if (!IsPostBack) { hdfUpdate.Value = "yes"; hdfLoginId.Value = Convert.ToInt32(Session["loginID"]).ToString(); tbxDescription.Text = Server.UrlDecode(Request.QueryString["subject"].ToString()); ViewState["refId"] = Request.QueryString["refId"].ToString(); ViewState["unitId"] = Request.QueryString["unit_id"].ToString(); ViewState["libraryCategoriesId"] = Request.QueryString["library_categories_id"].ToString(); unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; if (Session["libraryTDSForUnits"] != null) { libraryTDSForUnits = (LibraryTDS)Session["libraryTDSForUnits"]; } else { libraryTDSForUnits = new LibraryTDS(); } } else { unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; if (Session["libraryTDSForUnits"] != null) { libraryTDSForUnits = (LibraryTDS)Session["libraryTDSForUnits"]; } else { libraryTDSForUnits = new LibraryTDS(); } } }
// //////////////////////////////////////////////////////////////////////// // EVENTS // protected void Page_Load(object sender, EventArgs e) { // Register client scripts this.RegisterClientScripts(); if (!IsPostBack) { hdfUpdate.Value = "no"; libraryTDSForUnits = new LibraryTDS(); unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; Session["libraryTDSForUnits"] = libraryTDSForUnits; ViewState["unitId"] = int.Parse(Request.QueryString["unit_id"].ToString()); } else { libraryTDSForUnits = (LibraryTDS)Session["libraryTDSForUnits"]; unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; } }
private void UpdateDatabase() { int companyId = Int32.Parse(hdfCompanyId.Value); int unitId = Int32.Parse(hdfUnitId.Value); DB.Open(); DB.BeginTransaction(); try { // process view UnitInformationTDS dataset = new UnitInformationTDS(); dataset.ChecklistDetails.Merge(unitsChecklistRulesEdit, true); UnitInformationChecklistDetails model = new UnitInformationChecklistDetails(dataset); model.Save(unitId, companyId); DB.CommitTransaction(); // Store datasets unitInformationTDS.AcceptChanges(); Session["unitInformationTDS"] = unitInformationTDS; Session["unitsChecklistRulesEdit"] = unitsChecklistRulesEdit; } catch (Exception ex) { DB.RollbackTransaction(); string url = string.Format("./../../error_page.aspx?error={0}", ex.Message.Replace('\n', ' ')); Response.Redirect(url); } }
private void ChecklistRulesInformationProcessGrid() { UnitInformationTDS dataSet = new UnitInformationTDS(); dataSet.ChecklistDetails.Merge(unitsChecklistRulesEdit, true); UnitInformationChecklistDetails model = new UnitInformationChecklistDetails(dataSet); // update rows if (Session["unitsChecklistRulesEditDummy"] == null) { foreach (GridViewRow row in grdChecklistRulesInformation.Rows) { int ruleId = int.Parse(grdChecklistRulesInformation.DataKeys[row.RowIndex].Values["RuleID"].ToString()); DateTime? lastService = null; DateTime? nextDue = null; bool done = ((CheckBox)row.FindControl("cbxDone")).Checked; string state = ((DropDownList)row.FindControl("ddlState")).SelectedValue; if (((RadDatePicker)row.FindControl("tkrdpLastService")).SelectedDate.HasValue) { lastService = ((RadDatePicker)row.FindControl("tkrdpLastService")).SelectedDate.Value; } if (((RadDatePicker)row.FindControl("tkrdpNextDue")).SelectedDate.HasValue) { nextDue = ((RadDatePicker)row.FindControl("tkrdpNextDue")).SelectedDate.Value; } model.Update(ruleId, lastService, nextDue, state, done); } model.Table.AcceptChanges(); unitsChecklistRulesEdit = (UnitInformationTDS.ChecklistDetailsDataTable)model.Table; Session["unitsChecklistRulesEdit"] = unitsChecklistRulesEdit; } }
// //////////////////////////////////////////////////////////////////////// // INITIAL EVENTS // protected void Page_Load(object sender, EventArgs e) { // Register client scripts this.RegisterClientScripts(); if (!IsPostBack) { // Security check if (!(Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_UNITS_VIEW"]) && Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_UNITS_EDIT"]))) { Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator."); } // Validate query string if (((string)Request.QueryString["source_page"] == null) || ((string)Request.QueryString["unit_id"] == null)) { Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in units_checklist_rules.aspx"); } // Tag page hdfCompanyId.Value = Session["companyID"].ToString(); hdfUnitId.Value = Request.QueryString["unit_id"].ToString(); hdfUpdate.Value = "no"; // If coming from // ... units_summary.aspx and units_edit.aspx if (Request.QueryString["source_page"] == "units_summary.aspx" || Request.QueryString["source_page"] == "units_edit.aspx") { StoreNavigatorState(); ViewState["update"] = Request.QueryString["update"]; unitInformationTDS = new UnitInformationTDS(); unitsChecklistRulesEdit = new UnitInformationTDS.ChecklistDetailsDataTable(); int companyId = Int32.Parse(hdfCompanyId.Value.Trim()); int unitId = Int32.Parse(hdfUnitId.Value.Trim()); // Load UnitInformationTDS dataSet = new UnitInformationTDS(); dataSet.ChecklistDetails.Merge(unitsChecklistRulesEdit, true); UnitInformationChecklistDetails model = new UnitInformationChecklistDetails(dataSet); model.LoadByUnitIdWithoutInProgressRules(unitId, int.Parse(hdfCompanyId.Value)); // Store tables unitsChecklistRulesEdit = (UnitInformationTDS.ChecklistDetailsDataTable)model.Table; Session["unitsChecklistRulesEdit"] = unitsChecklistRulesEdit; grdChecklistRulesInformation.DataBind(); } } else { // Restore datasets unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; unitsChecklistRulesEdit = (UnitInformationTDS.ChecklistDetailsDataTable)Session["unitsChecklistRulesEdit"]; } }
// //////////////////////////////////////////////////////////////////////// // EVENTS // protected void Page_Load(object sender, EventArgs e) { // Register client scripts this.RegisterClientScripts(); if (!IsPostBack) { // Security check if (!(Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_UNITS_VIEW"]) && (Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_UNITS_EDIT"]) || Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_UNITS_COMMENTS"])))) { Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator."); } // Validate query string if (((string)Request.QueryString["source_page"] == null) || ((string)Request.QueryString["unit_id"] == null) || ((string)Request.QueryString["unit_type"] == null) || ((string)Request.QueryString["unit_state"] == null) || ((string)Request.QueryString["active_tab"] == null)) { Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in units_summary.aspx"); } // Tag Page hdfUnitId.Value = Request.QueryString["unit_id"].ToString(); hdfUnitType.Value = Request.QueryString["unit_type"].ToString(); hdfUnitState.Value = Request.QueryString["unit_state"].ToString(); hdfActiveTab.Value = Request.QueryString["active_tab"].ToString(); hdfCompanyId.Value = Session["companyID"].ToString(); hdfLoginId.Value = Convert.ToInt32(Session["loginID"]).ToString(); int companyId = Int32.Parse(hdfCompanyId.Value.Trim()); int unitId = Int32.Parse(hdfUnitId.Value.Trim()); Session.Remove("unitsChecklistRulesTempDummy"); Session.Remove("unitsServicesTempDummy"); Session.Remove("unitsInspectionsTempDummy"); Session.Remove("unitsNotesTempDummy"); Session.Remove("unitsCostsDummy"); Session.Remove("unitsCostsExceptionsDummy"); Session.Remove("costIdSelected"); // If coming from // ... units_navigator2.aspx or wucAlarms.ascx.cs if ((Request.QueryString["source_page"] == "units_navigator2.aspx") || (Request.QueryString["source_page"] == "wucAlarms.ascx")) { StoreNavigatorState(); ViewState["update"] = "no"; // ... ... Set initial tab if ((string)Session["dialogOpenedUnits"] != "1") { hdfActiveTab.Value = Request.QueryString["active_tab"]; unitInformationTDS = new UnitInformationTDS(); unitsChecklistRulesTemp = new UnitInformationTDS.ChecklistDetailsDataTable(); unitsServicesTemp = new UnitInformationTDS.ServiceDetailsDataTable(); unitsInspectionsTemp = new UnitInformationTDS.InspectionDetailsDataTable(); unitsNotesTemp = new UnitInformationTDS.NoteInformationDataTable(); UnitInformationUnitDetails unitInformationUnitDetails = new UnitInformationUnitDetails(unitInformationTDS); unitInformationUnitDetails.LoadByUnitId(unitId, companyId); UnitInformationInspectionDetails unitInformationInspectionDetailsForEdit = new UnitInformationInspectionDetails(unitInformationTDS); unitInformationInspectionDetailsForEdit.LoadByUnitId(unitId, companyId); UnitInformationNoteDetails unitInformationNoteDetails = new UnitInformationNoteDetails(unitInformationTDS); unitInformationNoteDetails.LoadByUnitId(unitId, companyId); UnitInformationCostInformation unitInformationCostInformation = new UnitInformationCostInformation(unitInformationTDS); unitInformationCostInformation.LoadAllByUnitId(unitId, companyId); UnitInformationCostExceptionsInformation unitInformationCostExceptionsInformation = new UnitInformationCostExceptionsInformation(unitInformationTDS); unitInformationCostExceptionsInformation.LoadAllByUnitId(unitId, companyId); Session["costIdSelected"] = 0; // ... For Categories categoriesTDS = new CategoriesTDS(); Category category = new Category(categoriesTDS); category.LoadByUnitType(hdfUnitType.Value, int.Parse(hdfCompanyId.Value)); // .. For Company Levels companyLevelsTDS = new CompanyLevelsTDS(); CompanyLevel companyLevel = new CompanyLevel(companyLevelsTDS); companyLevel.Load(int.Parse(hdfCompanyId.Value)); } else { hdfActiveTab.Value = (string)Session["activeTabUnits"]; // Restore datasets unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; unitsChecklistRulesTemp = (UnitInformationTDS.ChecklistDetailsDataTable)Session["unitsChecklistRulesTemp"]; unitsServicesTemp = (UnitInformationTDS.ServiceDetailsDataTable)Session["unitsServicesTemp"]; unitsInspectionsTemp = (UnitInformationTDS.InspectionDetailsDataTable)Session["unitsInspectionsTemp"]; unitsNotesTemp = (UnitInformationTDS.NoteInformationDataTable)Session["unitsNotesTemp"]; categoriesTDS = (CategoriesTDS)Session["categoriesTDSForUnits"]; companyLevelsTDS = (CompanyLevelsTDS)Session["companyLevelsTDS"]; } tcDetailedInformation.ActiveTabIndex = Int32.Parse(hdfActiveTab.Value); // Store dataset Session["unitInformationTDS"] = unitInformationTDS; Session["unitsChecklistRulesTemp"] = unitsChecklistRulesTemp; Session["unitsServicesTemp"] = unitsServicesTemp; Session["unitsInspectionsTemp"] = unitsInspectionsTemp; Session["unitsNotesTemp"] = unitsNotesTemp; Session["categoriesTDSForUnits"] = categoriesTDS; Session["companyLevelsTDS"] = companyLevelsTDS; } // ... units_add.aspx if (Request.QueryString["source_page"] == "units_add.aspx") { ViewState["update"] = "yes"; hdfActiveTab.Value = Request.QueryString["active_tab"]; unitInformationTDS = new UnitInformationTDS(); unitsChecklistRulesTemp = new UnitInformationTDS.ChecklistDetailsDataTable(); unitsServicesTemp = new UnitInformationTDS.ServiceDetailsDataTable(); unitsInspectionsTemp = new UnitInformationTDS.InspectionDetailsDataTable(); unitsNotesTemp = new UnitInformationTDS.NoteInformationDataTable(); UnitInformationUnitDetails unitInformationUnitDetails = new UnitInformationUnitDetails(unitInformationTDS); unitInformationUnitDetails.LoadByUnitId(unitId, companyId); UnitInformationNoteDetails unitInformationNoteDetails = new UnitInformationNoteDetails(unitInformationTDS); unitInformationNoteDetails.LoadByUnitId(unitId, companyId); // ... For Categories categoriesTDS = new CategoriesTDS(); Category category = new Category(categoriesTDS); category.LoadByUnitType(hdfUnitType.Value, int.Parse(hdfCompanyId.Value)); // .. For Company Levels companyLevelsTDS = new CompanyLevelsTDS(); CompanyLevel companyLevel = new CompanyLevel(companyLevelsTDS); companyLevel.Load(int.Parse(hdfCompanyId.Value)); tcDetailedInformation.ActiveTabIndex = Int32.Parse(hdfActiveTab.Value); // Store dataset Session["unitInformationTDS"] = unitInformationTDS; Session["unitsChecklistRulesTemp"] = unitsChecklistRulesTemp; Session["unitsServicesTemp"] = unitsServicesTemp; Session["unitsInspectionsTemp"] = unitsInspectionsTemp; Session["unitsNotesTemp"] = unitsNotesTemp; Session["categoriesTDSForUnits"] = categoriesTDS; Session["companyLevelsTDS"] = companyLevelsTDS; } // ... units_delete.aspx, units_edit.aspx or units_state.aspx if ((Request.QueryString["source_page"] == "units_delete.aspx") || (Request.QueryString["source_page"] == "units_edit.aspx") || (Request.QueryString["source_page"] == "units_state.aspx") ) { StoreNavigatorState(); ViewState["update"] = Request.QueryString["update"]; // Restore dataset unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; unitsChecklistRulesTemp = (UnitInformationTDS.ChecklistDetailsDataTable)Session["unitsChecklistRulesTemp"]; unitsServicesTemp = (UnitInformationTDS.ServiceDetailsDataTable)Session["unitsServicesTemp"]; unitsInspectionsTemp = (UnitInformationTDS.InspectionDetailsDataTable)Session["unitsInspectionsTemp"]; unitsNotesTemp = (UnitInformationTDS.NoteInformationDataTable)Session["unitsNotesTemp"]; categoriesTDS = (CategoriesTDS)Session["categoriesTDSForUnits"]; companyLevelsTDS = (CompanyLevelsTDS)Session["companyLevelsTDS"]; // ... Set initial tab if ((string)Session["dialogOpenedUnits"] != "1") { hdfActiveTab.Value = Request.QueryString["active_tab"]; } else { hdfActiveTab.Value = (string)Session["activeTabUnits"]; } tcDetailedInformation.ActiveTabIndex = Int32.Parse(hdfActiveTab.Value); } string filterOptions = string.Format("CostID = {0} AND Deleted = {1}", 0, 0); odsCostsExceptions.FilterExpression = filterOptions; // ... Data for current unit LoadUnitData(unitId, companyId); } else { // Restore datasets unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; unitsChecklistRulesTemp = (UnitInformationTDS.ChecklistDetailsDataTable)Session["unitsChecklistRulesTemp"]; unitsServicesTemp = (UnitInformationTDS.ServiceDetailsDataTable)Session["unitsServicesTemp"]; unitsInspectionsTemp = (UnitInformationTDS.InspectionDetailsDataTable)Session["unitsInspectionsTemp"]; unitsNotesTemp = (UnitInformationTDS.NoteInformationDataTable)Session["unitsNotesTemp"]; categoriesTDS = (CategoriesTDS)Session["categoriesTDSForUnits"]; companyLevelsTDS = (CompanyLevelsTDS)Session["companyLevelsTDS"]; // Set initial tab int activeTabUnits = Int32.Parse(hdfActiveTab.Value); tcDetailedInformation.ActiveTabIndex = activeTabUnits; } }
private void LoadServiceData(int unitId) { UnitInformationTDS dataset = new UnitInformationTDS(); dataset.ServiceDetails.Merge(unitsServicesTemp, true); UnitInformationServiceDetails model = new UnitInformationServiceDetails(dataset); model.Load(unitId, int.Parse(hdfCompanyId.Value)); unitsServicesTemp = (UnitInformationTDS.ServiceDetailsDataTable)model.Table; Session["unitsServicesTemp"] = unitsServicesTemp; grdServices.DataBind(); }
private void LoadInspectionData(int unitId) { UnitInformationTDS dataset = new UnitInformationTDS(); dataset.InspectionDetails.Merge(unitsInspectionsTemp, true); UnitInformationInspectionDetails model = new UnitInformationInspectionDetails(dataset); model.LoadByUnitId(unitId, int.Parse(hdfCompanyId.Value)); unitsInspectionsTemp = (UnitInformationTDS.InspectionDetailsDataTable)model.Table; Session["unitsInspectionsTemp"] = unitsInspectionsTemp; grdInspections.DataBind(); }
private void LoadChecklitData(int unitId) { // Load UnitInformationTDS dataSet = new UnitInformationTDS(); dataSet.ChecklistDetails.Merge(unitsChecklistRulesTemp, true); UnitInformationChecklistDetails model = new UnitInformationChecklistDetails(dataSet); model.Load(unitId, int.Parse(hdfCompanyId.Value)); // Store tables unitsChecklistRulesTemp = (UnitInformationTDS.ChecklistDetailsDataTable)model.Table; Session["unitsChecklistRulesTemp"] = unitsChecklistRulesTemp; grdChecklistRulesInformation.DataBind(); }
// //////////////////////////////////////////////////////////////////////// // EVENTS // protected void Page_Load(object sender, EventArgs e) { // Register client scripts this.RegisterClientScripts(); if (!IsPostBack) { // Security check if (!(Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_UNITS_VIEW"]) && (Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_UNITS_EDIT"]) || Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_UNITS_COMMENTS"])))) { Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator."); } // Validate query string if (((string)Request.QueryString["source_page"] == null) || ((string)Request.QueryString["unit_id"] == null) || ((string)Request.QueryString["unit_type"] == null) || ((string)Request.QueryString["unit_state"] == null) || ((string)Request.QueryString["active_tab"] == null)) { Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in units_edit.aspx"); } // Tag Page hdfUnitId.Value = Request.QueryString["unit_id"].ToString(); hdfUnitType.Value = Request.QueryString["unit_type"].ToString(); hdfUnitState.Value = Request.QueryString["unit_state"].ToString(); hdfActiveTab.Value = Request.QueryString["active_tab"].ToString(); hdfCompanyId.Value = Session["companyID"].ToString(); hdfLoginId.Value = Convert.ToInt32(Session["loginID"]).ToString(); int companyId = Int32.Parse(hdfCompanyId.Value.Trim()); int unitId = Int32.Parse(hdfUnitId.Value.Trim()); aceManufacturer.ContextKey = hdfCompanyId.Value; // ... For Owner country CountryList countryList = new CountryList(); countryList.LoadAndAddItem(-1, "(Select a country)"); ddlOwnerCountry.DataSource = countryList.Table; ddlOwnerCountry.DataValueField = "CountryID"; ddlOwnerCountry.DataTextField = "Name"; ddlOwnerCountry.DataBind(); // ... For License country ddlLicenseCountry.DataSource = countryList.Table; ddlLicenseCountry.DataValueField = "CountryID"; ddlLicenseCountry.DataTextField = "Name"; ddlLicenseCountry.DataBind(); Session.Remove("unitsChecklistRulesTempDummy"); Session.Remove("unitsServicesTempDummy"); Session.Remove("unitsInspectionsTempDummy"); Session.Remove("unitsNotesTempDummy"); Session.Remove("unitCostsDummy"); Session.Remove("unitCostsExceptionsDummy"); Session.Remove("costIdSelected"); // ... units_navigator2.aspx if (Request.QueryString["source_page"] == "units_navigator2.aspx") { StoreNavigatorState(); ViewState["update"] = "no"; // ... Set initial tab if ((string)Session["dialogOpenedUnits"] != "1") { hdfActiveTab.Value = Request.QueryString["active_tab"]; unitInformationTDS = new UnitInformationTDS(); unitsChecklistRulesTemp = new UnitInformationTDS.ChecklistDetailsDataTable(); unitsServicesTemp = new UnitInformationTDS.ServiceDetailsDataTable(); unitsInspectionsTemp = new UnitInformationTDS.InspectionDetailsDataTable(); unitsNotesTemp = new UnitInformationTDS.NoteInformationDataTable(); UnitInformationUnitDetails unitInformationUnitDetails = new UnitInformationUnitDetails(unitInformationTDS); unitInformationUnitDetails.LoadByUnitId(unitId, companyId); UnitInformationInspectionDetails unitInformationInspectionDetailsForEdit = new UnitInformationInspectionDetails(unitInformationTDS); unitInformationInspectionDetailsForEdit.LoadByUnitId(unitId, companyId); UnitInformationNoteDetails unitInformationNoteDetailsForEdit = new UnitInformationNoteDetails(unitInformationTDS); unitInformationNoteDetailsForEdit.LoadByUnitId(unitId, companyId); UnitInformationCostInformation unitInformationCostInformation = new UnitInformationCostInformation(unitInformationTDS); unitInformationCostInformation.LoadAllByUnitId(unitId, companyId); UnitInformationCostExceptionsInformation unitInformationCostExceptionsInformation = new UnitInformationCostExceptionsInformation(unitInformationTDS); unitInformationCostExceptionsInformation.LoadAllByUnitId(unitId, companyId); // ... For Categories categoriesTDS = new CategoriesTDS(); Category category = new Category(categoriesTDS); category.LoadByUnitType(hdfUnitType.Value, int.Parse(hdfCompanyId.Value)); // .. For Company Levels companyLevelsTDS = new CompanyLevelsTDS(); CompanyLevel companyLevel = new CompanyLevel(companyLevelsTDS); companyLevel.Load(int.Parse(hdfCompanyId.Value)); } else { hdfActiveTab.Value = (string)Session["activeTabUnits"]; // Restore datasets unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; unitsChecklistRulesTemp = (UnitInformationTDS.ChecklistDetailsDataTable)Session["unitsChecklistRulesTemp"]; unitsServicesTemp = (UnitInformationTDS.ServiceDetailsDataTable)Session["unitsServicesTemp"]; unitsInspectionsTemp = (UnitInformationTDS.InspectionDetailsDataTable)Session["unitsInspectionsTemp"]; unitsNotesTemp = (UnitInformationTDS.NoteInformationDataTable)Session["unitsNotesTemp"]; categoriesTDS = (CategoriesTDS)Session["categoriesTDSForUnits"]; companyLevelsTDS = (CompanyLevelsTDS)Session["companyLevelsTDS"]; } arrayCategoriesSelectedForEdit = new ArrayList(); arrayCompanyLevelsSelectedForEdit = new ArrayList(); Session["arrayCategoriesSelectedForEdit"] = arrayCategoriesSelectedForEdit; Session["arrayCompanyLevelsSelectedForEdit"] = arrayCompanyLevelsSelectedForEdit; // Store dataset Session["unitInformationTDS"] = unitInformationTDS; Session["unitsChecklistRulesTemp"] = unitsChecklistRulesTemp; Session["unitsServicesTemp"] = unitsServicesTemp; Session["unitsInspectionsTemp"] = unitsInspectionsTemp; Session["unitsNotesTemp"] = unitsNotesTemp; Session["categoriesTDSForUnits"] = categoriesTDS; Session["companyLevelsTDS"] = companyLevelsTDS; } // ... units_summary.aspx or units_edit.aspx if ((Request.QueryString["source_page"] == "units_summary.aspx") || (Request.QueryString["source_page"] == "units_edit.aspx")) { StoreNavigatorState(); ViewState["update"] = Request.QueryString["update"]; // Restore dataset unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; unitsChecklistRulesTemp = (UnitInformationTDS.ChecklistDetailsDataTable)Session["unitsChecklistRulesTemp"]; unitsServicesTemp = (UnitInformationTDS.ServiceDetailsDataTable)Session["unitsServicesTemp"]; unitsInspectionsTemp = (UnitInformationTDS.InspectionDetailsDataTable)Session["unitsInspectionsTemp"]; unitsNotesTemp = (UnitInformationTDS.NoteInformationDataTable)Session["unitsNotesTemp"]; categoriesTDS = (CategoriesTDS)Session["categoriesTDSForUnits"]; companyLevelsTDS = (CompanyLevelsTDS)Session["companyLevelsTDS"]; // ... Set initial tab if ((string)Session["dialogOpenedUnits"] != "1") { hdfActiveTab.Value = Request.QueryString["active_tab"]; if (ViewState["update"].ToString().Trim() == "yes") { UnitInformationUnitDetails unitInformationUnitDetails = new UnitInformationUnitDetails(unitInformationTDS); unitInformationUnitDetails.LoadByUnitId(unitId, companyId); UnitInformationInspectionDetails unitInformationInspectionDetailsForEdit = new UnitInformationInspectionDetails(unitInformationTDS); unitInformationInspectionDetailsForEdit.LoadByUnitId(unitId, companyId); UnitInformationNoteDetails unitInformationNoteDetailsForEdit = new UnitInformationNoteDetails(unitInformationTDS); unitInformationNoteDetailsForEdit.LoadByUnitId(unitId, companyId); UnitInformationCostInformation unitInformationCostInformation = new UnitInformationCostInformation(unitInformationTDS); unitInformationCostInformation.LoadAllByUnitId(unitId, companyId); UnitInformationCostExceptionsInformation unitInformationCostExceptionsInformation = new UnitInformationCostExceptionsInformation(unitInformationTDS); unitInformationCostExceptionsInformation.LoadAllByUnitId(unitId, companyId); // Store dataset Session["unitInformationTDS"] = unitInformationTDS; } } else { hdfActiveTab.Value = (string)Session["activeTabUnits"]; } arrayCategoriesSelectedForEdit = new ArrayList(); arrayCompanyLevelsSelectedForEdit = new ArrayList(); Session["arrayCategoriesSelectedForEdit"] = arrayCategoriesSelectedForEdit; Session["arrayCompanyLevelsSelectedForEdit"] = arrayCompanyLevelsSelectedForEdit; } // ... units_add.aspx if (Request.QueryString["source_page"] == "units_add.aspx") { ViewState["update"] = "yes"; unitInformationTDS = new UnitInformationTDS(); unitsChecklistRulesTemp = new UnitInformationTDS.ChecklistDetailsDataTable(); unitsServicesTemp = new UnitInformationTDS.ServiceDetailsDataTable(); unitsInspectionsTemp = new UnitInformationTDS.InspectionDetailsDataTable(); unitsNotesTemp = new UnitInformationTDS.NoteInformationDataTable(); UnitInformationUnitDetails unitInformationUnitDetails = new UnitInformationUnitDetails(unitInformationTDS); unitInformationUnitDetails.LoadByUnitId(unitId, companyId); UnitInformationNoteDetails unitInformationNoteDetailsForEdit = new UnitInformationNoteDetails(unitInformationTDS); unitInformationNoteDetailsForEdit.LoadByUnitId(unitId, companyId); // ... For Categories categoriesTDS = new CategoriesTDS(); Category category = new Category(categoriesTDS); category.LoadByUnitType(hdfUnitType.Value, int.Parse(hdfCompanyId.Value)); // .. For Company Levels companyLevelsTDS = new CompanyLevelsTDS(); CompanyLevel companyLevel = new CompanyLevel(companyLevelsTDS); companyLevel.Load(int.Parse(hdfCompanyId.Value)); arrayCategoriesSelectedForEdit = new ArrayList(); arrayCompanyLevelsSelectedForEdit = new ArrayList(); Session["arrayCategoriesSelectedForEdit"] = arrayCategoriesSelectedForEdit; Session["arrayCompanyLevelsSelectedForEdit"] = arrayCompanyLevelsSelectedForEdit; // Store dataset Session["unitInformationTDS"] = unitInformationTDS; Session["unitsChecklistRulesTemp"] = unitsChecklistRulesTemp; Session["unitsServicesTemp"] = unitsServicesTemp; Session["unitsInspectionsTemp"] = unitsInspectionsTemp; Session["unitsNotesTemp"] = unitsNotesTemp; Session["categoriesTDSForUnits"] = categoriesTDS; Session["companyLevelsTDS"] = companyLevelsTDS; } // ... For Library if (Session["libraryTDSForUnits"] != null) { libraryTDSForUnits = (LibraryTDS)Session["libraryTDSForUnits"]; } else { libraryTDSForUnits = new LibraryTDS(); } Session["costIdSelected"] = 0; grdCostsExceptions.ShowFooter = false; string filterOptions = string.Format("CostID = {0} AND Deleted = {1}", 0, 0); odsCostsExceptions.FilterExpression = filterOptions; // Set initial tab int activeTabUnits = Int32.Parse(hdfActiveTab.Value); tcDetailedInformation.ActiveTabIndex = activeTabUnits; // ... ... Make panels visible MakePanelsVisible(); // ... ... Data for current unit LoadUnitData(companyId); } else { // Restore datasets unitInformationTDS = (UnitInformationTDS)Session["unitInformationTDS"]; unitsChecklistRulesTemp = (UnitInformationTDS.ChecklistDetailsDataTable)Session["unitsChecklistRulesTemp"]; unitsServicesTemp = (UnitInformationTDS.ServiceDetailsDataTable)Session["unitsServicesTemp"]; unitsInspectionsTemp = (UnitInformationTDS.InspectionDetailsDataTable)Session["unitsInspectionsTemp"]; unitsNotesTemp = (UnitInformationTDS.NoteInformationDataTable)Session["unitsNotesTemp"]; categoriesTDS = (CategoriesTDS)Session["categoriesTDSForUnits"]; companyLevelsTDS = (CompanyLevelsTDS)Session["companyLevelsTDS"]; arrayCategoriesSelectedForEdit = (ArrayList)Session["arrayCategoriesSelectedForEdit"]; arrayCompanyLevelsSelectedForEdit = (ArrayList)Session["arrayCompanyLevelsSelectedForEdit"]; // Set initial tab int activeTabUnits = Int32.Parse(hdfActiveTab.Value); tcDetailedInformation.ActiveTabIndex = activeTabUnits; aceManufacturer.ContextKey = hdfCompanyId.Value; if (Session["libraryTDSForUnits"] != null) { libraryTDSForUnits = (LibraryTDS)Session["libraryTDSForUnits"]; } else { libraryTDSForUnits = new LibraryTDS(); } LoadNotes(); } }
/// <summary> /// InitData /// </summary> protected override void InitData() { _data = new UnitInformationTDS(); }