/// <summary> /// InitData /// </summary> protected override void InitData() { _data = new ServicesTDS(); }
// //////////////////////////////////////////////////////////////////////// // EVENTS // protected void Page_Load(object sender, EventArgs e) { // Register client scripts this.RegisterClientScripts(); if (!IsPostBack) { // Security check if (!(Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_SERVICES_VIEW"]) && Convert.ToBoolean(Session["sgLFS_FLEETMANAGEMENT_SERVICES_DELETE"]))) { 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["service_id"] == null) || ((string)Request.QueryString["dashboard"] == null)) { Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in services_delete.aspx"); } // Tag Page hdfCompanyId.Value = Session["companyID"].ToString(); hdfServiceId.Value = Request.QueryString["service_id"].ToString(); hdfDashboard.Value = Request.QueryString["dashboard"].ToString(); hdfFmType.Value = "Services"; // If comming from // ... services_navigator2.aspx if (Request.QueryString["source_page"] == "services_navigator2.aspx") { StoreNavigatorState(); ViewState["update"] = "no"; serviceInformationTDS = new ServiceInformationTDS(); servicesTDS = new ServicesTDS(); int serviceId = Int32.Parse(hdfServiceId.Value); int companyId = Int32.Parse(hdfCompanyId.Value); ServiceInformationBasicInformation serviceInformationBasicInformation = new ServiceInformationBasicInformation(serviceInformationTDS); serviceInformationBasicInformation.LoadByServiceId(serviceId, companyId); ServiceInformationServiceCost serviceInformationServiceCostForEdit = new ServiceInformationServiceCost(serviceInformationTDS); serviceInformationServiceCostForEdit.LoadByServiceId(serviceId, companyId); ServiceInformationServiceNote serviceInformationServiceNoteForEdit = new ServiceInformationServiceNote(serviceInformationTDS); serviceInformationServiceNoteForEdit.LoadByServiceId(serviceId, companyId); // Store dataset Session["serviceInformationTDS"] = serviceInformationTDS; Session["servicesTDS"] = servicesTDS; } // ... services_summary.aspx if (Request.QueryString["source_page"] == "services_summary.aspx") { StoreNavigatorState(); ViewState["update"] = Request.QueryString["update"]; // Restore dataset servicesTDS = (ServicesTDS)Session["servicesTDS"]; serviceInformationTDS = (ServiceInformationTDS)Session["serviceInformationTDS"]; } } else { // Restore datasets servicesTDS = (ServicesTDS)Session["servicesTDS"]; serviceInformationTDS = (ServiceInformationTDS)Session["serviceInformationTDS"]; } }