private void Generate()
        {
            mReport1 master = (mReport1)this.Master;

            // Get Data
            RaLiningPlanTDS raLiningPlanTDS = (RaLiningPlanTDS)Session["raLiningPlanTDS"];
            RaLiningPlan raLiningPlan = new RaLiningPlan();
            raLiningPlan.ProcessForReport(raLiningPlanTDS);

            // ... set properties to master page
            master.Data = raLiningPlan.Data;
            master.Table = raLiningPlan.TableName;

            // Get report
            if (raLiningPlan.Table.Rows.Count > 0)
            {
                master.Report = new RaLiningPlanReport();

                //master.SetParameter("User", Session["justeMail"].ToString());
                int loginId = Convert.ToInt32(Session["loginID"]);
                int companyId = Convert.ToInt32(Session["companyID"]);

                LoginGateway loginGateway = new LoginGateway();
                loginGateway.LoadByLoginId(loginId, companyId);
                string user = loginGateway.GetLastName(loginId, companyId) + " " + loginGateway.GetFirstName(loginId, companyId);
                master.SetParameter("User", user.Trim());
            }
        }
        private void PostPageChanges()
        {
            RaLiningPlan raLiningPlan = new RaLiningPlan(raLiningPlanTDS);

            // Update section-setups
            foreach (GridViewRow row in grdLiningPlan.Rows)
            {
                int workId = int.Parse(((HiddenField)row.FindControl("hdfWorkId")).Value);
                int companyId = int.Parse(((HiddenField)row.FindControl("hdfCompanyId")).Value);
                DateTime? date_ = null; if (((RadDatePicker)row.FindControl("tkrdpDate_")).SelectedDate.HasValue) date_ = ((RadDatePicker)row.FindControl("tkrdpDate_")).SelectedDate.Value;
                string flusher = ((DropDownList)row.FindControl("ddlFlusherTruck")).SelectedValue;
                string flusherMN = ((DropDownList)row.FindControl("ddlFlusherMN")).SelectedValue;
                string video = ((DropDownList)row.FindControl("ddlVideoTruck")).SelectedValue;
                string videoMN = ((DropDownList)row.FindControl("ddlVideoMN")).SelectedValue;
                string selected = ((DropDownList)row.FindControl("ddlSelected")).SelectedValue;

                raLiningPlan.UpdateForReport(workId, companyId, date_, flusher, flusherMN, video, videoMN, selected);
            }

            // Store datasets
            Session["raLiningPlanTDS"] = raLiningPlanTDS;
        }