Esempio n. 1
0
        // /////////////////////////////////////////////////////////////////////////////////////////////////////
        //
        // STEP6 - SUMMARY
        //
        // ////////////////////////////////////////////////////////////////////////
        // STEP6 - SUMMARY - METHODS
        //
        private void StepSummaryIn()
        {
            // Set instruction
            Label instruction = (Label)this.Master.FindControl("lblInstruction");
            instruction.Text = "Summary";

            // Tag Page
            hdfStep.Value = "StepSummary";
            hdfUpdate.Value = "yes";

            // Initialize summary
            WorkView workView = new WorkView(workViewTDS);

            // process view
            WorkViewTDS dataset = new WorkViewTDS();
            dataset.WorkViewDisplayTemp.Merge(workViewDisplayTemp, true);
            dataset.WorkViewConditionNew.Merge(workViewConditionNew, true);
            dataset.WorkViewSortTemp.Merge(workViewSortTemp, true);

            WorkViewDisplayTemp modelWorkViewDisplayTemp = new WorkViewDisplayTemp(dataset);
            WorkViewConditionNew modelWorkViewConditionNew = new WorkViewConditionNew(dataset);
            WorkViewSortTemp modelWorkViewSortTemp = new WorkViewSortTemp(dataset);

            string summary = "";
            summary = summary + "Name: " + tbxName.Text + "\n\n";
            summary = summary + "Columns To Display; " + modelWorkViewDisplayTemp.GetColumnsToDisplay() + "\n\n";
            summary = summary + "Conditions: " + modelWorkViewConditionNew.GetConditionsForSummary(hdfWorkType.Value, int.Parse(hdfCompanyId.Value)) + "\n\n";
            summary = summary + "Logical Expression: " + tbxLogic.Text + "\n\n";
            summary = summary + "Order by: " + modelWorkViewSortTemp.GetSortForSummary() + "\n\n";

            tbxSummary.Text = summary;
        }
Esempio n. 2
0
        private void Save()
        {
            // process view
            WorkViewTDS dataset = new WorkViewTDS();
            dataset.WorkViewDisplayTemp.Merge(workViewDisplayTemp, true);
            dataset.WorkViewConditionNew.Merge(workViewConditionNew, true);
            dataset.WorkViewSortTemp.Merge(workViewSortTemp, true);

            WorkViewDisplayTemp modelWorkViewDisplayTemp = new WorkViewDisplayTemp(dataset);
            WorkViewConditionNew modelWorkViewConditionNew = new WorkViewConditionNew(dataset);
            WorkViewSortTemp modelWorkViewSortTemp = new WorkViewSortTemp(dataset);

            // get parameters
            int viewId = int.Parse(hdfViewId.Value);
            int companyId = int.Parse(hdfCompanyId.Value);
            int loginId = Convert.ToInt32(Session["loginID"]);
            string name = tbxName.Text;
            string type = ddlType.SelectedValue;
            string logic = tbxLogic.Text;
            string sqlCommand = GetSqlCommand();
            string workType = hdfWorkType.Value;

            if (!(Convert.ToBoolean(Session["sgLFS_VIEWS_ADD"])))
            {
                if ((string)Request.QueryString["fm_type"] == "Rehab Assessment")
                {
                    if (Convert.ToBoolean(Session["sgLFS_CWP_REHABASSESSMENT_VIEW"]))
                    {
                        type = "Personal";
                    }
                }

                if ((string)Request.QueryString["fm_type"] == "Full Length Lining")
                {
                    if (Convert.ToBoolean(Session["sgLFS_CWP_FULLLENGTHLINING_VIEW"]))
                    {
                        type = "Personal";
                    }
                }

                if ((string)Request.QueryString["fm_type"] == "Junction Lining")
                {
                    if (Convert.ToBoolean(Session["sgLFS_CWP_JUNCTIONLINING_VIEW"]))
                    {
                        type = "Personal";
                    }
                }

                if ((string)Request.QueryString["fm_type"] == "Point Repairs")
                {
                    if (Convert.ToBoolean(Session["sgLFS_CWP_POINTREPAIRS_VIEW"]))
                    {
                        type = "Personal";
                    }
                }

                if ((string)Request.QueryString["fm_type"] == "Manhole Repairs")
                {
                    if (Convert.ToBoolean(Session["sgLFS_CWP_MANHOLEREHABILITATION_VIEW"]))
                    {
                        type = "Personal";
                    }
                }
            }

            // save to database
            DB.Open();
            DB.BeginTransaction();
            try
            {
                WorkView workView = new WorkView(null);
                workView.InsertDirect(viewId, loginId, name, type, logic, sqlCommand, workType, false, companyId);

                modelWorkViewDisplayTemp.Save();
                modelWorkViewConditionNew.Save(viewId, companyId, workType);
                modelWorkViewSortTemp.Save(viewId, workType, companyId);

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

                string url = string.Format("./../../error_page.aspx?error={0}", ex.Message.Replace('\n', ' '));
                Response.Redirect(url);
            }
        }
Esempio n. 3
0
        private bool StepColumnsToDisplayNext()
        {
            ViewState["columnsToDisplayPageIndex"] = grdColumnsToDisplay.PageIndex;

            Page.Validate("ColumsToDisplay");

            if (Page.IsValid)
            {
                StepColumnsToDisplayProcessGrid();
                workViewDisplayTemp.Rows.Clear();

                // create dataset
                WorkViewTDS dataSet = new WorkViewTDS();
                dataSet.LFS_WORK_TYPE_VIEW_DISPLAY.Merge(workTypeViewDisplay, true);
                dataSet.WorkViewDisplayTemp.Merge(workViewDisplayTemp, true);

                // process new sections
                WorkViewDisplayTemp model = new WorkViewDisplayTemp(dataSet);
                model.Process(int.Parse(hdfViewId.Value), hdfWorkType.Value, int.Parse(hdfCompanyId.Value));

                // get changes
                workViewDisplayTemp.Rows.Clear();
                workViewDisplayTemp.Merge(model.Table);

                // store tables
                Session.Remove("workTypeViewDisplayDummy");
                Session["workTypeViewDisplay"] = workTypeViewDisplay;
                Session["workViewDisplayTemp"] = workViewDisplayTemp;

                return true;
            }
            else
            {
                return false;
            }
        }
        private bool StepColumnsToDisplayNext()
        {
            ViewState["columnsToDisplayPageIndex"] = grdColumnsToDisplay.PageIndex;

            Page.Validate("ColumsToDisplay");

            if (Page.IsValid)
            {
                hdfStep.Value = "StepColumnsToDisplay";
                StepColumnsToDisplayProcessGrid();
                workViewDisplayTemp.Rows.Clear();

                // create dataset
                WorkViewTDS dataSet = new WorkViewTDS();
                dataSet.LFS_WORK_TYPE_VIEW_DISPLAY.Merge(workTypeViewDisplay, true);
                dataSet.WorkViewDisplayTemp.Merge(workViewDisplayTemp, true);

                // process
                WorkViewDisplayTemp model = new WorkViewDisplayTemp(dataSet);
                model.ProcessForEdit(int.Parse(hdfViewId.Value), hdfWorkType.Value, int.Parse(hdfCompanyId.Value));

                // get changes
                workViewDisplayTemp.Rows.Clear();
                workViewDisplayTemp.Merge(model.Table);

                // store tables
                Session.Remove("workTypeViewDisplayDummy");
                Session["workTypeViewDisplay"] = workTypeViewDisplay;
                Session["workViewDisplayTemp"] = workViewDisplayTemp;

                // load conditions for next step
                dataSet.WorkViewConditionNew.Merge(workViewConditionNew, true);
                dataSet.WorkViewConditionTemp.Merge(workViewConditionTemp, true);

                WorkViewConditionNew modelConditionNew = new WorkViewConditionNew(dataSet);
                modelConditionNew.LoadByViewIdCompanyIdWorkType(int.Parse(hdfViewId.Value), int.Parse(hdfCompanyId.Value), hdfWorkType.Value);

                // Store tables
                workViewConditionNew = (WorkViewTDS.WorkViewConditionNewDataTable)modelConditionNew.Table;
                Session["workViewConditionNew"] = workViewConditionNew;

                return true;
            }
            else
            {
                return false;
            }
        }