当前位置: 首页>>代码示例>>C#>>正文


C# ProjectGateway.GetName方法代码示例

本文整理汇总了C#中LiquiForce.LFSLive.DA.Projects.Projects.ProjectGateway.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectGateway.GetName方法的具体用法?C# ProjectGateway.GetName怎么用?C# ProjectGateway.GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LiquiForce.LFSLive.DA.Projects.Projects.ProjectGateway的用法示例。


在下文中一共展示了ProjectGateway.GetName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnSearch_Click

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            // Get data from database gateway
            ProjectSectionsNavigatorTDS projectSectionsNavigatorTDS = SubmitSearch();

            // Show results
            if (projectSectionsNavigatorTDS.LFS_PROJECT_SECTIONS_NAVIGATOR.DefaultView.Count > 0)
            {
                // ... Store data
                Session["lfsProjectSectionsNavigatorTDS"] = projectSectionsNavigatorTDS;

                // ... Go to the results page
                Response.Redirect("./project_sections_navigator2.aspx?source_page=project_sections_navigator.aspx&project_id=" + hdfProjectId.Value + GetNavigatorState() + "&origin=" + (string)ViewState["origin"] + "&update=" + (string)ViewState["update"] + "&data_changed=" + hdfDataChanged.Value + "&state=" + (string)ViewState["state"] + "&update_section=no&active_tab=" + (string)ViewState["active_tab"]);
            }
            else
            {
                ProjectGateway projectGateway = new ProjectGateway(projectTDS);
                lblTitleProjectName.Text = projectGateway.GetName(int.Parse(hdfProjectId.Value)) + " (" + projectGateway.GetProjectNumber(int.Parse(hdfProjectId.Value)) + ")";
                tNoResults.Visible = true;
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:21,代码来源:project_sections_navigator.aspx.cs

示例2: Page_Load

        // ////////////////////////////////////////////////////////////////////////
        // EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            // Register client scripts
            this.RegisterClientScripts();

            if (!IsPostBack)
            {
                // Security check
                if (!(Convert.ToBoolean(Session["sgLFS_CWP_JUNCTIONLINING_VIEW"]) && Convert.ToBoolean(Session["sgLFS_CWP_JUNCTIONLINING_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["client_id"] == null) || ((string)Request.QueryString["project_id"] == null))
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in jls_delete.aspx");
                }

                // Tag Page
                hdfCompanyId.Value = Session["companyID"].ToString();
                hdfCurrentProjectId.Value = Request.QueryString["project_id"].ToString();
                hdfCurrentClientId.Value = Request.QueryString["client_id"].ToString();

                // Prepare initial data
                // ... for client
                int currentClientId = Int32.Parse(hdfCurrentClientId.Value.ToString());
                int companyId = Int32.Parse(hdfCompanyId.Value);

                CompaniesGateway companiesGateway = new CompaniesGateway();
                companiesGateway.LoadByCompaniesId(currentClientId, companyId);
                lblTitleClientName.Text = "Client: " + companiesGateway.GetName(currentClientId);

                // ... for project
                int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value.ToString());
                ProjectGateway projectGateway = new ProjectGateway();
                projectGateway.LoadByProjectId(currentProjectId);
                string name = projectGateway.GetName(currentProjectId);
                if (name.Length > 23) name = name.Substring(0, 20) + "...";
                lblTitleProjectName.Text = " > Project: " + name + " (" + projectGateway.GetProjectNumber(currentProjectId) + ") > Selected Sections";

                // If coming from
                // ... jls_navigator2.aspx
                if (Request.QueryString["source_page"] == "jls_navigator2.aspx")
                {
                    StoreNavigatorState();
                    ViewState["update"] = "no";
                }

                // ... flat_section_jls_summary.aspx
                if (Request.QueryString["source_page"] == "flat_section_jls_summary.aspx")
                {
                    StoreNavigatorState();
                    ViewState["update"] = Request.QueryString["update"];
                }

                // Restore datasets
                flatSectionJlsTDS = (FlatSectionJlsTDS)Session["flatSectionJlsTDS"];
            }
            else
            {
                // Restore datasets
                flatSectionJlsTDS = (FlatSectionJlsTDS)Session["flatSectionJlsTDS"];
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:68,代码来源:jls_delete.aspx.cs

示例3: btnExportList_Click

        protected void btnExportList_Click(object sender, EventArgs e)
        {
            mForm7 master = (mForm7)this.Master;
            ScriptManager scriptManager = (ScriptManager)master.FindControl("ScriptManagerMaster7");

            if (!scriptManager.IsInAsyncPostBack)
            {
                string url = "";
                string headerValues = "";
                int totalColumnsExport = 11;
                int totalColumnsPreview = 11;
                string client = "";
                string name = "";
                string project = "";
                string title = "Manhole Rehabilitation Search Results";
                string columnsForReport = "";
                int j;

                // ... for client
                int companyId = Int32.Parse(hdfCompanyId.Value);
                int currentClientId = Int32.Parse(hdfCurrentClientId.Value.ToString());
                CompaniesGateway companiesGateway = new CompaniesGateway();
                companiesGateway.LoadByCompaniesId(currentClientId, companyId);
                client += "Client: " + companiesGateway.GetName(currentClientId);

                // ... for project
                int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value.ToString());
                ProjectGateway projectGateway = new ProjectGateway();
                projectGateway.LoadByProjectId(currentProjectId);
                project = projectGateway.GetName(currentProjectId);
                name = client + " > Project: " + project + " (" + projectGateway.GetProjectNumber(currentProjectId) + ")";

                // ... for title view
                if (hdfBtnOrigin.Value == "Go")
                {
                    int viewId = Int32.Parse(ddlView.SelectedValue.Trim());

                    // ... Load name view
                    WorkViewGateway workViewGateway = new WorkViewGateway();
                    workViewGateway.LoadByViewId(viewId, companyId);

                    title = workViewGateway.GetName(viewId);
                }

                // ... For comments option
                string comments = "None";

                headerValues = "";
                columnsForReport = "";

                // Establishing header values
                if (grdMRNavigator.Columns[1].Visible) headerValues += "Manhole No";
                if (grdMRNavigator.Columns[2].Visible) headerValues += " * Street";
                if (grdMRNavigator.Columns[3].Visible) headerValues += " * Latitude";
                if (grdMRNavigator.Columns[4].Visible) headerValues += " * Longitude";
                if (grdMRNavigator.Columns[5].Visible) headerValues += " * Shape";
                if (grdMRNavigator.Columns[6].Visible) headerValues += " * Location";
                if (grdMRNavigator.Columns[7].Visible) headerValues += " * Condition Rating";
                if (grdMRNavigator.Columns[8].Visible) headerValues += " * Prepped Date";
                if (grdMRNavigator.Columns[9].Visible) headerValues += " * Sprayed Date";
                if (grdMRNavigator.Columns[10].Visible) headerValues += " * Batch Date";
                if (grdMRNavigator.Columns[11].Visible) headerValues += " * Comments";

                // Establishing columns to display
                string[] columnsExcel = headerValues.Split('*');

                // ... for visible columns
                for (int i = 0; i < columnsExcel.Length; i++)
                {
                    j = i + 1;
                    columnsForReport += "&header" + j + "=" + columnsExcel[i].Trim();
                }

                // ... For not visible columns
                for (int i = columnsExcel.Length; i < totalColumnsExport; i++)
                {
                    j = i + 1;
                    columnsForReport += "&header" + j + "=None";
                }

                // Report call
                Page.Validate();
                if (Page.IsValid)
                {
                    PostPageChanges();
                    title = title.Replace("'", "%27");
                    Response.Write("<script language='javascript'> {window.open('./mr_print_search_results_report.aspx?" + columnsForReport + "&comments=" + comments + "&totalColumnsPreview=" + totalColumnsPreview + "&totalColumnsExport=" + totalColumnsExport + "&totalSelectedColumns=" + columnsExcel.Length + "&name=" + Server.UrlEncode(name) + "&title=" + Server.UrlEncode(title) + "&format=excel', '_blank', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=800, height=680');}</script>");
                }

                if (url != "") Response.Redirect(url);
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:92,代码来源:mr_navigator2.aspx.cs

示例4: Generate

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

            // Get Data
            JlLiningPlanTDS jlLiningPlanTDS = (JlLiningPlanTDS)Session["jlLiningPlanTDS"];
            JlLiningPlan jlLiningPlan = new JlLiningPlan();
            jlLiningPlan.ProcessForReport(jlLiningPlanTDS);

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

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

                // ... for client
                int companyId = Int32.Parse(Session["companyID"].ToString());
                int currentClientId = Int32.Parse(hdfCurrentClientId.Value);
                CompaniesGateway companiesGateway = new CompaniesGateway();
                companiesGateway.LoadByCompaniesId(currentClientId, companyId);
                master.SetParameter("Client", companiesGateway.GetName(currentClientId));

                // ... for project
                int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value);
                ProjectGateway projectGateway = new ProjectGateway();
                projectGateway.LoadByProjectId(currentProjectId);
                string name = projectGateway.GetName(currentProjectId);
                master.SetParameter("Project", projectGateway.GetProjectNumber(currentProjectId));

                int loginId = Convert.ToInt32(Session["loginID"]);

                LoginGateway loginGateway = new LoginGateway();
                loginGateway.LoadByLoginId(loginId, companyId);
                string user = loginGateway.GetLastName(loginId, companyId) + " " + loginGateway.GetFirstName(loginId, companyId);
                master.SetParameter("User", user.Trim());
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:40,代码来源:jl_lining_plan_report.aspx.cs

示例5: ProcessDataForProject

        /// <summary>
        /// ProcessDataForProject
        /// </summary>
        /// <param name="companyId">companyId</param>
        /// <para>Process de data from the original table for the Project Costing report </para>  
        private void ProcessDataForProject(int currentProjectId, string currentPhase, int companyId)
        {
            ArrayList alDays = new ArrayList();
            double rateAcum = 0;
            int numPeriods = 0;

            string projectName = "";
            ProjectGateway projectGateway = new ProjectGateway();
            projectGateway.LoadByProjectId(currentProjectId);
            projectName = projectGateway.GetName(currentProjectId);

            foreach (PrintManhoursPerPhaseTDS.PrintManHoursPerPhaseRARow rowOriginal in (PrintManhoursPerPhaseTDS.PrintManHoursPerPhaseRADataTable)Table)
            {
                if (rowOriginal.ProjectName.Contains(projectName) && rowOriginal.Phase.Contains(currentPhase))
                {
                    if (!rowOriginal.IsTotalFtNull())
                    {
                        Distance distOriginal = new Distance(rowOriginal.TotalFt);
                        rowOriginal.TotalFtDouble = distOriginal.ToDoubleInEng3();
                        rowOriginal.RealFt = distOriginal.ToDoubleInEng3();
                    }
                    else
                    {
                        rowOriginal.TotalFtDouble = 0;
                        rowOriginal.RealFt = 0;
                    }

                    rateAcum = rateAcum + rowOriginal.RealFt / rowOriginal.Hrs;

                    // For get number of periods
                    if (!alDays.Contains(rowOriginal.Date))
                    {
                        alDays.Add(rowOriginal.Date);
                        numPeriods = numPeriods + 1;
                    }
                }
            }

            foreach (PrintManhoursPerPhaseTDS.PrintManHoursPerPhaseRARow row2 in (PrintManhoursPerPhaseTDS.PrintManHoursPerPhaseRADataTable)Table)
            {
                if (row2.ProjectName.Contains(projectName) && row2.Phase.Contains(currentPhase))
                {
                    row2.AverageRate = rateAcum / numPeriods;
                    row2.NumPeriods = numPeriods;
                }
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:52,代码来源:PrintManHoursPerPhaseRA.cs

示例6: Generate3

        private void Generate3()
        {
            mReportForM12 master = (mReportForM12)this.Master;
            string unitType = ddlUnitType.SelectedValue;
            int companyId = Convert.ToInt32(hdfCompanyId.Value);

            FlM1ReportTDS flM1ReportTDS = new FlM1ReportTDS();

            // Get Data
            LiquiForce.LFSLive.BL.CWP.FullLengthLining.FlM1Report flM1Report = new LiquiForce.LFSLive.BL.CWP.FullLengthLining.FlM1Report(flM1ReportTDS);
            LiquiForce.LFSLive.BL.CWP.FullLengthLining.FlM12Report flM2Report = new LiquiForce.LFSLive.BL.CWP.FullLengthLining.FlM12Report(flM1ReportTDS);

            GetM1Data(flM1Report, unitType, companyId);
            GetM2Data(flM2Report, unitType);

            // ... set properties to master page
            //FlM1ReportTDS dataSet = new FlM1ReportTDS();
            //dataSet.M1ReportByClient.Merge(flM1Report, true);
            //dataSet.M2_SECTION.Merge(flM2Report, true);

            master.Data3 = flM1ReportTDS;
            master.Table1 = flM1Report.TableName;
            master.Table2 = flM2Report.TableName;

            // Get report
            if (flM2Report.Table.Rows.Count > 0 || flM1Report.Table.Rows.Count > 0)
            {
                if (master.Format3 == "pdf")
                {
                    master.Report3 = new FlM12Report();

                    if (ddlClient.SelectedValue != "-1")
                    {
                        // ... for client
                        int currentClientId = Int32.Parse(ddlClient.SelectedValue);

                        CompaniesGateway companiesGateway = new CompaniesGateway();
                        companiesGateway.LoadByCompaniesId(currentClientId, companyId);

                        master.SetParameter3("Client", companiesGateway.GetName(currentClientId));
                    }
                    else
                    {
                        master.SetParameter3("Client", "All");
                    }

                    if (ddlProject.SelectedValue != "-1")
                    {
                        // ... for project
                        int currentProjectId = Int32.Parse(ddlProject.SelectedValue);

                        ProjectGateway projectGateway = new ProjectGateway();
                        projectGateway.LoadByProjectId(currentProjectId);

                        string name = projectGateway.GetName(currentProjectId);
                        master.SetParameter3("Project", name);
                    }
                    else
                    {
                        master.SetParameter3("Project", "All");
                    }

                    master.SetParameter3("UnitType", unitType);

                    int loginId = Convert.ToInt32(Session["loginID"]);

                    LoginGateway loginGateway = new LoginGateway();
                    loginGateway.LoadByLoginId(loginId, companyId);
                    string user = loginGateway.GetLastName(loginId, companyId) + " " + loginGateway.GetFirstName(loginId, companyId);
                    master.SetParameter3("User", user.Trim());
                }
                else
                {
                    //master.Report2 = new FlM12ReportExport();
                }
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:77,代码来源:fl_m12_report.aspx.cs

示例7: Page_Load

        // ////////////////////////////////////////////////////////////////////////
        // EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            // Register client scripts
            this.RegisterClientScripts();

            if (!IsPostBack)
            {
                // Validate query string
                if (((string)Request.QueryString["source_page"] == null) && ((string)Request.QueryString["others"] == null) && ((string)Request.QueryString["employee_id"] == null) && ((string)Request.QueryString["period_id"] == null) && ((string)Request.QueryString["projecttime_id"] == null))
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in timesheet_summary.aspx");
                }

                // Security check
                if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_FULL_EDITING"]))
                {
                    if (Request.QueryString["others"] == "no")
                    {
                        if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_MY_TIMESHEETS_VIEW"]))
                        {
                            if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_MY_TIMESHEETS_MANAGEMENT"]))
                            {
                                if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_MY_TIMESHEETS_MANAGEMENT_WED"]))
                                {
                                    Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator.");
                                }
                            }
                        }
                    }
                    else
                    {
                        if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_MY_TIMESHEETS_VIEW"]))
                        {
                            if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_MY_TIMESHEETS_MANAGEMENT"]))
                            {
                                if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_MY_TIMESHEETS_MANAGEMENT_WED"]))
                                {
                                    if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_OTHERS_TIMESHEETS_VIEW"]))
                                    {
                                        if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_OTHERS_TIMESHEETS_MANAGEMENT"]))
                                        {
                                            if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_OTHERS_TIMESHEETS_MANAGEMENT_WED"]))
                                            {
                                                Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator.");
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                // Initialize viewstate's variables
                ViewState["others"] = Request.QueryString["others"];
                ViewState["employee_id"] = int.Parse(Request.QueryString["employee_id"]);
                ViewState["period_id"] = int.Parse(Request.QueryString["period_id"]);
                ViewState["projecttime_id"] = int.Parse(Request.QueryString["projecttime_id"]);
                System.Configuration.AppSettingsReader appSettingReader = new System.Configuration.AppSettingsReader();
                ViewState["LHMode"] = appSettingReader.GetValue("LABOUR_HOURS_OPERATION_MODE", typeof(System.String)).ToString();

                // Get ProjectTime record
                projectTimeTDS =  new ProjectTimeTDS();

                ProjectTimeGateway projectTimeGateway = new ProjectTimeGateway(projectTimeTDS);
                projectTimeGateway.LoadByProjectTimeId((int)ViewState["projecttime_id"]);

                // Store datasets
                Session["projectTimeTDS"] = projectTimeTDS;

                // Databind
                tbxDate.DataBind();
                tbxWorkingDetails.DataBind();
                tbxStartTime.DataBind();
                tbxEndTime.DataBind();
                tbxLunch.DataBind();
                tbxComments.DataBind();
                tbxState.DataBind();

                // Prepare initial data for client
                StoreNavigatorState();

                EmployeeGateway employeeGateway = new EmployeeGateway(new DataSet());
                employeeGateway.LoadByEmployeeId((int)ViewState["employee_id"]);
                tbxEmployee.Text = employeeGateway.GetFullName((int)ViewState["employee_id"]);

                int companyId = Int32.Parse(Session["companyID"].ToString());

                CompaniesGateway companiesGateway = new CompaniesGateway(new DataSet());
                companiesGateway.LoadAllByCompaniesId(projectTimeGateway.GetCompaniesId((int)ViewState["projecttime_id"]), companyId);
                tbxClient.Text = companiesGateway.GetName(projectTimeGateway.GetCompaniesId((int)ViewState["projecttime_id"]));

                ProjectGateway projectGateway = new ProjectGateway(new DataSet());
                projectGateway.LoadByProjectId(projectTimeGateway.GetProjectId((int)ViewState["projecttime_id"]));
                tbxProject.Text = projectGateway.GetName(projectTimeGateway.GetProjectId((int)ViewState["projecttime_id"])) + "(" + projectGateway.GetProjectNumber(projectTimeGateway.GetProjectId((int)ViewState["projecttime_id"])) + ")";

                if (projectGateway.GetFairWageApplies(projectTimeGateway.GetProjectId((int)ViewState["projecttime_id"])))
//.........这里部分代码省略.........
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:101,代码来源:timesheet_summary.aspx.cs

示例8: Page_Load

        // ////////////////////////////////////////////////////////////////////////
        // EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            // Register client scripts
            this.RegisterClientScripts();

            if (!IsPostBack)
            {
                // Security check
                if (!Convert.ToBoolean(Session["sgLFS_CWP_POINTREPAIRS_VIEW"]))
                {
                    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["client_id"] == null) || ((string)Request.QueryString["project_id"] == null))
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in pr_lining_plan.aspx");
                }

                // Tag Page
                hdfCompanyId.Value = Session["companyID"].ToString();
                hdfCurrentProjectId.Value = Request.QueryString["project_id"].ToString();
                hdfCurrentClientId.Value = Request.QueryString["client_id"].ToString();
                hdfWorkType.Value = "Point Repairs";

                // Prepare initial data

                // ... for client
                int currentClientId = Int32.Parse(hdfCurrentClientId.Value.ToString());
                int companyId = Int32.Parse(hdfCompanyId.Value);

                CompaniesGateway companiesGateway = new CompaniesGateway();
                companiesGateway.LoadByCompaniesId(currentClientId, companyId);
                lblTitleClientName.Text = "Client: " + companiesGateway.GetName(currentClientId);

                // ... for project
                int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value.ToString());
                ProjectGateway projectGateway = new ProjectGateway();
                projectGateway.LoadByProjectId(currentProjectId);
                string name = projectGateway.GetName(currentProjectId);
                if (name.Length > 23) name = name.Substring(0, 20) + "...";
                lblTitleProjectName.Text = " > Project: " + name + " (" + projectGateway.GetProjectNumber(currentProjectId) + ") > Lining Plan";

                // ... for the grid
                prLiningPlanTDS = new PlLiningPlanTDS();
                int projectId = Int32.Parse(hdfCurrentProjectId.Value);

                PrLiningPlanGateway prLiningPlanGateway = new PrLiningPlanGateway(prLiningPlanTDS);
                prLiningPlanGateway.ClearBeforeFill = false;
                prLiningPlanGateway.Load(projectId, companyId);

                grdLiningPlan.DataSource = prLiningPlanGateway.Table;
                grdLiningPlan.DataBind();

                // Check results
                if (prLiningPlanTDS.PlLiningPlan.Rows.Count > 0)
                {
                    tPreview.Visible = true;
                    tdNoResults.Visible = false;
                    tbFooterToolbar.Visible = true;
                }
                else
                {
                    tPreview.Visible = false;
                    tdNoResults.Visible = true;
                    tbFooterToolbar.Visible = false;
                }

                // Check results
                if (prLiningPlanTDS.PlLiningPlan.Rows.Count == 1)
                {
                    tbFooterToolbar.Visible = false;
                }

                // Store dataset
                Session["prLiningPlanTDS"] = prLiningPlanTDS;
            }
            else
            {
                // Restore dataset
                prLiningPlanTDS = (PlLiningPlanTDS)Session["prLiningPlanTDS"];

                // ... for the grid
                PrLiningPlanGateway prLiningPlanGateway = new PrLiningPlanGateway(prLiningPlanTDS);
                grdLiningPlan.DataSource = prLiningPlanGateway.Table;
                grdLiningPlan.DataBind();
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:91,代码来源:pr_lining_plan.aspx.cs

示例9: Load

        // ////////////////////////////////////////////////////////////////////////
        // PUBLIC METHODS
        //
        /// <summary>
        /// Load
        /// </summary>
        /// <param name="projectId">projectId</param>
        /// <param name="startDate">startDate</param>
        /// <param name="endDate">endDate</param>
        /// <param name="companyId">companyId</param>
        public void Load(ArrayList projects, DateTime startDate, DateTime endDate, int companyId, int clientId)
        {
            int refId = 0;

            foreach (int projectId in projects)
            {
                ProjectGateway projectGateway = new ProjectGateway();
                projectGateway.LoadByProjectId(projectId);

                string project = projectGateway.GetName(projectId);

                ProjectCostingSheetAddSubcontractorListGateway projectCostingSheetAddSubcontractorListGateway = new ProjectCostingSheetAddSubcontractorListGateway(Data);
                projectCostingSheetAddSubcontractorListGateway.LoadByProjectIdStartDateEndDate(projectId, startDate, endDate, companyId);

                foreach (ProjectCostingSheetAddTDS.SubcontractorListRow subcontractorListRow in (ProjectCostingSheetAddTDS.SubcontractorListDataTable)projectCostingSheetAddSubcontractorListGateway.Table)
                {
                    DateTime newStartDate = new DateTime();
                    newStartDate = startDate;
                    DateTime newEndDate = new DateTime();
                    newEndDate = endDate;

                    ProjectCostingSheetAddOriginalSubcontractorGateway projectCostingSheetAddOriginalSubcontractorGateway = new ProjectCostingSheetAddOriginalSubcontractorGateway(Data);
                    projectCostingSheetAddOriginalSubcontractorGateway.LoadByProjectIdStartDateEndDateSubcontractorId(projectId, newStartDate, newEndDate, subcontractorListRow.SubcontractorID);

                    if (projectCostingSheetAddOriginalSubcontractorGateway.Table.Rows.Count > 0)
                    {
                        foreach (ProjectCostingSheetAddTDS.OriginalSubcontractorRow originalSubcontractorRow in (ProjectCostingSheetAddTDS.OriginalSubcontractorDataTable)projectCostingSheetAddOriginalSubcontractorGateway.Table)
                        {
                            ProjectCostingSheetAddTDS.CombinedSubcontractorsInformationRow newRow = ((ProjectCostingSheetAddTDS.CombinedSubcontractorsInformationDataTable)Table).NewCombinedSubcontractorsInformationRow();
                            newRow.CostingSheetID = 0;
                            newRow.SubcontractorID = subcontractorListRow.SubcontractorID;
                            newRow.RefID = refId++;
                            newRow.Quantity = originalSubcontractorRow.Quantity;
                            newRow.CostCad = originalSubcontractorRow.RateCad;
                            newRow.TotalCostCad = (Convert.ToDecimal(originalSubcontractorRow.Quantity) * originalSubcontractorRow.RateCad);
                            newRow.CostUsd = originalSubcontractorRow.RateUsd;
                            newRow.TotalCostUsd = (Convert.ToDecimal(originalSubcontractorRow.Quantity) * originalSubcontractorRow.RateUsd);
                            newRow.Deleted = false;
                            newRow.InDatabase = false;
                            newRow.COMPANY_ID = companyId;
                            newRow.Comment = ""; if (!originalSubcontractorRow.IsCommentNull()) newRow.Comment = originalSubcontractorRow.Comment;
                            newRow.UnitOfMeasurement = subcontractorListRow.UnitOfMeasurement;
                            //newRow.StartDate = newStartDate;
                            newRow.StartDate = originalSubcontractorRow.Date_;
                            newRow.EndDate = newEndDate;
                            newRow.FromDatabase = true;
                            newRow.Subcontractor = originalSubcontractorRow.Subcontractor;
                            newRow.ClientID = clientId;
                            newRow.ProjectID = projectId;
                            newRow.Project = project;
                            ((ProjectCostingSheetAddTDS.CombinedSubcontractorsInformationDataTable)Table).AddCombinedSubcontractorsInformationRow(newRow);
                        }
                    }
                }
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:66,代码来源:ProjectCombinedCostingSheetAddSubcontractorsInformation.cs

示例10: Page_Load

        // ////////////////////////////////////////////////////////////////////////
        // EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            // Register client scripts
            this.RegisterClientScripts();

            if (!IsPostBack)
            {
                // Security check
                if (!Convert.ToBoolean(Session["sgLFS_PROJECTS_VIEW"]))
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator.");
                }

                // Validate query string
                if (Request.QueryString["source_page"] == null)
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in project_sections_navigator2.aspx");
                }

                projectTDS = (ProjectTDS)Session["lfsProjectTDS"];
                assetsTDS = new AssetsTDS();
                lfsAssetsTDS = new LfsAssetsTDS();
                workTDS = new WorkTDS();

                // Tag page
                hdfCompanyId.Value = Session["companyID"].ToString();
                hdfProjectId.Value = Request.QueryString["project_id"];
                hdfDataChanged.Value = Request.QueryString["data_changed"];
                hdfDataChangedMessage.Value = "Changes made to this project will not be saved.";
                ViewState["state"] = Request.QueryString["state"];
                ViewState["active_tab"] = Request.QueryString["active_tab"];
                ViewState["origin"] = Request.QueryString["origin"];
                ViewState["update"] = Request.QueryString["update"];

                Session.Remove("projectSectionsNavigatorNewDummy");
                Session.Remove("projectSectionsNavigator");

                // Prepare initial data
                lblError.Visible = false;

                // ... for project
                int currentProjectId = Int32.Parse(hdfProjectId.Value.ToString());
                ProjectGateway projectGateway = new ProjectGateway();
                projectGateway.LoadByProjectId(currentProjectId);
                string name = projectGateway.GetName(currentProjectId);
                if (name.Length > 23) name = name.Substring(0, 20) + "...";
                lblTitleProjectName.Text = name + " (" + projectGateway.GetProjectNumber(currentProjectId) + ")";

                // ... for client
                int companyId = Int32.Parse(hdfCompanyId.Value.Trim());
                int currentClientId = projectGateway.GetClientID(Int32.Parse(hdfProjectId.Value.ToString()));
                CompaniesGateway companiesGateway = new CompaniesGateway();
                companiesGateway.LoadAllByCompaniesId(currentClientId, companyId);
                lblTitleClientName.Text = "Client: " + companiesGateway.GetName(currentClientId);

                hdfClientId.Value = projectGateway.GetClientID(int.Parse(hdfProjectId.Value)).ToString();

                // Store navigator state at projects navigator
                StoreNavigatorState();

                // ... project_sections_navigator.aspx or project_sections_navigator2.aspx
                if ((Request.QueryString["source_page"] == "project_sections_navigator.aspx") || (Request.QueryString["source_page"] == "project_sections_navigator2.aspx"))
                {
                    // Restore navigator state
                    RestoreNavigatorState();

                    // Restore data
                    projectSectionsNavigatorTDS = (ProjectSectionsNavigatorTDS)Session["lfsProjectSectionsNavigatorTDS"];
                    projectSectionsNavigator = projectSectionsNavigatorTDS.LFS_PROJECT_SECTIONS_NAVIGATOR;

                    // Store data
                    Session["projectSectionsNavigator"] = projectSectionsNavigatorTDS.LFS_PROJECT_SECTIONS_NAVIGATOR;

                    if (Request.QueryString["update_section"] == "no")
                    {
                        // Restore data
                        projectSectionsNavigatorTDS = (ProjectSectionsNavigatorTDS)Session["lfsProjectSectionsNavigatorTDS"];
                        projectSectionsNavigator = projectSectionsNavigatorTDS.LFS_PROJECT_SECTIONS_NAVIGATOR;

                        // Store data
                        Session["projectSectionsNavigator"] = projectSectionsNavigatorTDS.LFS_PROJECT_SECTIONS_NAVIGATOR;
                    }
                    else
                    {
                        // ... Delete store data
                        Session.Contents.Remove("lfsProjectSectionsNavigatorTDS");

                        // ... Search data with updates
                        projectSectionsNavigatorTDS = SubmitSearch();

                        // ... store datasets
                        Session["lfsProjectSectionsNavigatorTDS"] = projectSectionsNavigatorTDS;
                        Session["projectSectionsNavigator"] = projectSectionsNavigatorTDS.LFS_PROJECT_SECTIONS_NAVIGATOR;
                    }

                    //... for the total rows
                    if (projectSectionsNavigatorTDS.LFS_PROJECT_SECTIONS_NAVIGATOR.Rows.Count > 0)
//.........这里部分代码省略.........
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:101,代码来源:project_sections_navigator2.aspx.cs

示例11: Page_Load

        // ////////////////////////////////////////////////////////////////////////
        // EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            // Register client scripts
            this.RegisterClientScripts();

            if (!IsPostBack)
            {
                // Security check
                if (!(Convert.ToBoolean(Session["sgLFS_CWP_JUNCTIONLINING_VIEW"])))
                {
                    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["client_id"] == null) || ((string)Request.QueryString["project_id"] == null) || ((string)Request.QueryString["work_type"] == null))
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in jl_navigator.aspx");
                }

                // Tag Page
                hdfCompanyId.Value = Session["companyID"].ToString();
                hdfCurrentProjectId.Value = Request.QueryString["project_id"].ToString();
                hdfCurrentClientId.Value = Request.QueryString["client_id"].ToString();
                hdfWorkType.Value = Request.QueryString["work_type"].ToString();

                // Prepare initial data
                // ... For sortByList
                odsSortByList.DataBind();
                ddlSortBy.DataSourceID = "odsSortByList";
                ddlSortBy.DataValueField = "SortID";
                ddlSortBy.DataTextField = "Name";
                ddlSortBy.DataBind();

                // ... For
                odsViewForDisplayList.DataBind();
                odsViewForDisplayList2.DataBind();

                // ... For view ddl
                int companyId = Int32.Parse(hdfCompanyId.Value.Trim());
                string workType = hdfWorkType.Value;
                int loginId = Convert.ToInt32(Session["loginID"]);
                string viewTypeGlobal = "";
                string viewTypePersonal = "Personal";

                // Global Views check
                if (Convert.ToBoolean(Session["sgLFS_GLOBALVIEWS_VIEW"]))
                {
                    viewTypeGlobal = "Global";
                }

                WorkViewList workViewList = new WorkViewList();
                workViewList.LoadAndAddItem(workType, viewTypeGlobal, viewTypePersonal, loginId, companyId);
                ddlView.DataSource = workViewList.Table;
                ddlView.DataValueField = "ViewID";
                ddlView.DataTextField = "Name";
                ddlView.DataBind();
                ddlView.SelectedIndex = 1;

                WorkTypeViewSubAreaList workTypeViewSubAreaList = new WorkTypeViewSubAreaList();
                workTypeViewSubAreaList.LoadAndAddItem("Junction Lining", Int32.Parse(hdfCompanyId.Value), int.Parse(hdfCurrentProjectId.Value), "(All)");
                ddlSubArea.DataSource = workTypeViewSubAreaList.Table;
                ddlSubArea.DataValueField = "SubArea";
                ddlSubArea.DataTextField = "SubArea";
                ddlSubArea.DataBind();

                // ... for client
                int currentClientId = Int32.Parse(hdfCurrentClientId.Value.ToString());

                CompaniesGateway companiesGateway = new CompaniesGateway();
                companiesGateway.LoadByCompaniesId(currentClientId, companyId);
                lblTitleClientName.Text = "Client: " + companiesGateway.GetName(currentClientId);

                // ... for project
                int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value.ToString());
                ProjectGateway projectGateway = new ProjectGateway();
                projectGateway.LoadByProjectId(currentProjectId);
                string name = projectGateway.GetName(currentProjectId);
                if (name.Length > 23) name = name.Substring(0, 20) + "...";
                lblTitleProjectName.Text = " > Project: " + name + " (" + projectGateway.GetProjectNumber(currentProjectId) + ")";

                // If coming from

                // ... Left Menu, select_project.aspx or Projects2.aspx
                if ((Request.QueryString["source_page"] == "lm") || (Request.QueryString["source_page"] == "select_project.aspx") || (Request.QueryString["source_page"] == "Projects2.aspx"))
                {
                    tdNoResults.Visible = false;
                }

                // ... jl_navigator2.aspx
                if (Request.QueryString["source_page"] == "jl_navigator2.aspx")
                {
                    RestoreNavigatorState();
                    if ((string)Request.QueryString["no_results"] == "yes")
                    {
                        tdNoResults.Visible = true;
                    }
                    else
//.........这里部分代码省略.........
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:101,代码来源:jl_navigator.aspx.cs

示例12: Generate

        private void Generate()
        {
            mReport1 master = (mReport1)this.Master;
            LiquiForce.LFSLive.BL.CWP.ManholeRehabilitation.MrSummaryReport mrSummaryReport = new LiquiForce.LFSLive.BL.CWP.ManholeRehabilitation.MrSummaryReport();
            int companyId = Int32.Parse(hdfCompanyId.Value);

            Page.Validate();
            if (Page.IsValid)
            {
                // Get Data
                // For all clients
                if (ddlClient.SelectedValue == "-1")
                {
                    // validate checkboxes
                    if (cbxMhId.Checked)
                    {
                        ArrayList assetId = new ArrayList();
                        foreach (ListItem lst in cbxlMhId.Items)
                        {
                            if (lst.Selected)
                            {
                                assetId.Add(lst.Value);
                            }
                        }

                        mrSummaryReport.LoadByAssetId(companyId, assetId);
                    }
                }

                // For specific client
                else
                {
                    // For all projects
                    if (ddlProject.SelectedValue == "-1")
                    {
                        if (cbxMhId.Checked)
                        {
                            ArrayList assetId = new ArrayList();
                            foreach (ListItem lst in cbxlMhId.Items)
                            {
                                if (lst.Selected)
                                {
                                    assetId.Add(lst.Value);
                                }
                            }

                            mrSummaryReport.LoadByCompaniesIdAssetId(companyId, int.Parse(ddlClient.SelectedValue), assetId);
                        }
                    }
                    // For specific project
                    else
                    {
                        if (cbxMhId.Checked)
                        {
                            ArrayList assetId = new ArrayList();
                            foreach (ListItem lst in cbxlMhId.Items)
                            {
                                if (lst.Selected)
                                {
                                    assetId.Add(lst.Value);
                                }
                            }

                            mrSummaryReport.LoadByCompaniesIdProjectIdAssetId(companyId, int.Parse(ddlClient.SelectedValue), int.Parse(ddlProject.SelectedValue), assetId);
                        }
                    }
                }
            }

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

            // Get report
            if (mrSummaryReport.Table.Rows.Count > 0)
            {
                if (master.Format == "pdf")
                {
                    master.Report = new MrSummaryReport();
                }
                else
                {
                    master.Report = new MrSummaryReportExport();
                }

                // ... set parameters to report
                if (master.Format == "pdf")
                {
                    if (ddlClient.SelectedValue != "-1")
                    {
                        // ... for client
                        int currentClientId = Int32.Parse(ddlClient.SelectedValue);

                        CompaniesGateway companiesGateway = new CompaniesGateway();
                        companiesGateway.LoadByCompaniesId(currentClientId, companyId);
                        master.SetParameter("Client", companiesGateway.GetName(currentClientId));
                    }
                    else
                    {
                        master.SetParameter("Client", "All");
//.........这里部分代码省略.........
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:101,代码来源:mr_summary_report.aspx.cs

示例13: Page_Load


//.........这里部分代码省略.........

                            // Restore datasets
                            manholeRehabilitationTDS = (ManholeRehabilitationTDS)Session["manholeRehabilitationTDS"];
                        }

                        // ... Store dataset
                        Session["manholeRehabilitationTDS"] = manholeRehabilitationTDS;
                    }

                    // ... mr_summary.aspx or mr_edit.aspx
                    if ((Request.QueryString["source_page"] == "mr_summary.aspx") || (Request.QueryString["source_page"] == "mr_edit.aspx"))
                    {
                        StoreNavigatorState();
                        ViewState["update"] = Request.QueryString["update"];

                        // ... Restore dataset
                        manholeRehabilitationTDS = (ManholeRehabilitationTDS)Session["manholeRehabilitationTDS"];

                        // ... Set initial tab
                        if ((string)Session["dialogOpenedMr"] != "1")
                        {
                            hdfActiveTab.Value = Request.QueryString["active_tab"];
                        }
                        else
                        {
                            hdfActiveTab.Value = (string)Session["activeTabMr"];
                        }

                        if (ViewState["update"].ToString().Trim() == "yes")
                        {
                            ManholeRehabilitationManholeDetails manholeRehabilitationManholeDetails = new ManholeRehabilitationManholeDetails(manholeRehabilitationTDS);
                            manholeRehabilitationManholeDetails.LoadByAssetId(assetId, companyId);

                            ManholeRehabilitationWorkDetails fullLengthLiningWorkDetails = new ManholeRehabilitationWorkDetails(manholeRehabilitationTDS);
                            fullLengthLiningWorkDetails.LoadByWorkIdAssetId(workId, assetId, companyId);

                            // ... Store dataset
                            Session["manholeRehabilitationTDS"] = manholeRehabilitationTDS;
                        }
                    }

                    // Set initial data
                    int activeTab = Int32.Parse(hdfActiveTab.Value);
                    tcMrDetails.ActiveTabIndex = activeTab;
                    lblBatchDateRequired.Visible = false;

                    if ((hdfCurrentClientId.Value != "0") && (hdfCurrentProjectId.Value != "0"))
                    {
                        // ... for client
                        int currentClientId = Int32.Parse(hdfCurrentClientId.Value.ToString());
                        CompaniesGateway companiesGateway = new CompaniesGateway();
                        companiesGateway.LoadByCompaniesId(currentClientId, companyId);
                        lblTitleClientName.Text = "Client: " + companiesGateway.GetName(currentClientId);

                        // ... for project
                        ProjectGateway projectGateway = new ProjectGateway();
                        projectGateway.LoadByProjectId(currentProjectId);
                        string name = projectGateway.GetName(currentProjectId);
                        if (name.Length > 23) name = name.Substring(0, 20) + "...";
                        lblTitleProjectName.Text = " > Project: " + name + " (" + projectGateway.GetProjectNumber(currentProjectId) + ") > Selected Manhole";
                    }
                    else
                    {
                        lblTitleClientName.Text = "";
                        lblTitleProjectName.Text = "";
                    }

                    // ... For batch dates
                    WorkManholeRehabilitationBatchList workManholeRehabilitationBatchList = new WorkManholeRehabilitationBatchList();
                    workManholeRehabilitationBatchList.LoadAndAddItem(-1, "(Select a batch)", companyId);
                    ddlRehabilitationBatchDate.DataSource = workManholeRehabilitationBatchList.Table;
                    ddlRehabilitationBatchDate.DataValueField = "BatchID";
                    ddlRehabilitationBatchDate.DataTextField = "Description";
                    ddlRehabilitationBatchDate.DataBind();

                    // ... ... Data for current manhole rehabilitation work
                    LoadManholeRehabilitationData(currentProjectId, assetId, companyId);

                    // ... ... Make panels visible
                    ShapeStructure();

                    // Databind
                    Page.DataBind();

                    // For usmh, dsmh autocomplete
                    string provinceId_ = "0"; if (hdfProvinceId.Value != "") provinceId_ = hdfProvinceId.Value;
                    string countyId_ = "0"; if (hdfCountyId.Value != "") countyId_ = hdfCountyId.Value;
                    string cityId_ = "0"; if (hdfCityId.Value != "") cityId_ = hdfCityId.Value;
                }
            }
            else
            {
                // Restore datasets
                manholeRehabilitationTDS = (ManholeRehabilitationTDS)Session["manholeRehabilitationTDS"];

                // Set initial tab
                int activeTab = Int32.Parse(hdfActiveTab.Value);
                tcMrDetails.ActiveTabIndex = activeTab;
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:101,代码来源:mr_edit.aspx.cs

示例14: masterParameters

        private void masterParameters(mReport1 master)
        {
            DateTime startDate = DateTime.Parse(tkrdpStartDate.SelectedDate.Value.ToShortDateString());
            DateTime endDate = DateTime.Parse(tkrdpEndDate.SelectedDate.Value.ToShortDateString());
            int companyId = Int32.Parse(hdfCompanyId.Value);

            // ... set parameters to report
            if (master.Format == "pdf")
            {
                // ... ... client
                if (ddlClient.SelectedValue != "-1")
                {
                    int currentClientId = Int32.Parse(ddlClient.SelectedValue);
                    CompaniesGateway companiesGateway = new CompaniesGateway();
                    companiesGateway.LoadByCompaniesId(currentClientId, companyId);
                    master.SetParameter("Client", companiesGateway.GetName(currentClientId));
                }
                else
                {
                    master.SetParameter("Client", "All");
                }

                // ... ...  project
                if (ddlProject.SelectedValue != "-1")
                {
                    int currentProjectId = Int32.Parse(ddlProject.SelectedValue);
                    ProjectGateway projectGateway = new ProjectGateway();
                    projectGateway.LoadByProjectId(currentProjectId);
                    string name = projectGateway.GetName(currentProjectId);
                    master.SetParameter("Project", name);
                }
                else
                {
                    master.SetParameter("Project", "All");
                }

                // ... ... category
                if (ddlCategory.SelectedValue != "-1")
                {
                    string currentCategory = ddlCategory.SelectedValue;
                    master.SetParameter("Category", currentCategory);
                }
                else
                {
                    master.SetParameter("Category", "All");
                }

                // ... ... user
                LoginGateway loginGateway = new LoginGateway();
                loginGateway.LoadByLoginId(Convert.ToInt32(Session["loginID"]), companyId);
                string user = loginGateway.GetLastName(Convert.ToInt32(Session["loginID"]), companyId) + " " + loginGateway.GetFirstName(Convert.ToInt32(Session["loginID"]), companyId);
                master.SetParameter("User", user.Trim());

                // ... for start date
                string startDateParameter = startDate.Month.ToString() + "/" + startDate.Day.ToString() + "/" + startDate.Year.ToString();
                master.SetParameter("StartDate", startDateParameter);

                // ... for end date
                string endDateParameter = endDate.Month.ToString() + "/" + endDate.Day.ToString() + "/" + endDate.Year.ToString();
                master.SetParameter("EndDate", endDateParameter);
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:62,代码来源:actual_costs_report.aspx.cs

示例15: Generate


//.........这里部分代码省略.........
                    else
                    {
                        int projectId = int.Parse(ddlProject.SelectedValue);
                        productionReport.LoadByCountryIdClientIdProjectIdStartDateEndDate(country, clientId, projectId, startDate, endDate, companyId);
                    }
                }
            }

            LiquiForce.LFSLive.DA.Projects.Projects.ProductionReportGateway productionReportGateway = new LiquiForce.LFSLive.DA.Projects.Projects.ProductionReportGateway(productionReport.Data);

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

            // Get report
            if (productionReportGateway.Table.Rows.Count > 0)
            {
                if (master.Format == "pdf")
                {
                    master.Report = new LiquiForce.LFSLive.WebUI.Projects.Projects.ProductionReport();
                }
                else
                {
                    master.Report = new LiquiForce.LFSLive.WebUI.Projects.Projects.ProductionReportExport();
                }

                // ... set parameters to report
                if (master.Format == "pdf")
                {
                    // ... ...  user
                    int loginId = Convert.ToInt32(Session["loginID"]);

                    LoginGateway loginGateway = new LoginGateway();
                    loginGateway.LoadByLoginId(loginId, companyId);
                    string user = loginGateway.GetLastName(loginId, companyId) + " " + loginGateway.GetFirstName(loginId, companyId);
                    master.SetParameter("User", user.Trim());

                    // ... ... country
                    if (ddlCountry.SelectedValue == "2")
                    {
                        master.SetParameter("Country", "USA");
                    }
                    else
                    {
                        if (ddlCountry.SelectedValue == "1")
                        {
                            master.SetParameter("Country", "Canada");
                        }
                        else
                        {
                            master.SetParameter("Country", "All");
                        }
                    }

                    // ... ... project
                    if (ddlProject.SelectedValue == "-1")
                    {
                        master.SetParameter("Project", "All");
                    }
                    else
                    {
                        int projectId2 = Int32.Parse(ddlProject.SelectedValue);
                        ProjectGateway projectGateway = new ProjectGateway();
                        projectGateway.LoadByProjectId(projectId2);
                        string project = projectGateway.GetName(projectId2);
                        master.SetParameter("Project", project);
                    }

                    // ... ... Date
                    string startDateParameter = tkrdpStartDate.SelectedDate.Value.ToShortDateString();
                    master.SetParameter("StartDate", startDateParameter);

                    string endDateParameter = tkrdpEndDate.SelectedDate.Value.ToShortDateString();
                    master.SetParameter("EndDate", endDateParameter);

                    // ... ... client
                    if (ddlClient.SelectedValue == "-1")
                    {
                        master.SetParameter("Client", "All");
                    }
                    else
                    {
                        int currentClientId = Int32.Parse(ddlClient.SelectedValue);

                        CompaniesGateway companiesGateway = new CompaniesGateway();
                        companiesGateway.LoadByCompaniesId(currentClientId, companyId);
                        master.SetParameter("Client", companiesGateway.GetName(currentClientId));
                    }
                }
                else
                {
                    // ... ... Date
                    string startDateParameter = tkrdpStartDate.SelectedDate.Value.ToShortDateString();
                    master.SetParameter("StartDate", startDateParameter);

                    string endDateParameter = tkrdpEndDate.SelectedDate.Value.ToShortDateString();
                    master.SetParameter("EndDate", endDateParameter);
                }
            }
        }
开发者ID:NosDeployer,项目名称:TestBranching,代码行数:101,代码来源:production_report.aspx.cs


注:本文中的LiquiForce.LFSLive.DA.Projects.Projects.ProjectGateway.GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。