コード例 #1
0
        private void btnBuild_Click(object sender, System.EventArgs e)
        {
            OTCReport report = new OTCReport(Convert.ToInt32(this.txtReportTypeId.Value));
            string startDate = this.cldStartDate.SelectedDate.ToShortDateString();
            string endDate   = this.cldEndDate.SelectedDate.ToShortDateString();
            string qstring   = "report.aspx?RID=" + this.txtReportTypeId.Value + "&STD=" + startDate + "&EDT=" + endDate;
            //if(this.ddPartner.Visible && this.ddPartner.SelectedIndex > 0)
            //	qstring += "&PID=" + this.ddPartner.SelectedValue;
            //if(this.ddLineOrders.Visible && this.ddLineOrders.SelectedIndex > 0)
            //	qstring += "&LID=" + this.ddLineOrders.SelectedValue;

            Response.Redirect(qstring);
        }
コード例 #2
0
        //==================================
        //
        //==================================
        private void Page_Load(object sender, System.EventArgs e)
        {
            string strCookieValue = "";

            this.m_isCSV = Request.QueryString.ToString().IndexOf("csv") > -1;

            //Grab the cookie
            HttpCookie cookie = Request.Cookies["ExportToExcel"];

            //Check to make sure the cookie exists
            if (null != cookie)
            {
                //Write the cookie value
                strCookieValue = cookie.Value.ToString();
            }
            if(strCookieValue == "true")
                this.m_isCSV = true;

            if(this.m_isCSV)
                Response.ContentType = "text/plain";

            this.m_page  = new ITCPage();
            this.m_page.HideWest = true;

            //if(!(this.m_page.CheckLogin()))
            //	Response.Redirect("/interceuticals/admin/login.aspx");

            DataRow[] rows;
            this.m_reportId      = Convert.ToInt32(Request.QueryString["RID"]);
            this.m_partnerId     = Request.QueryString.ToString().IndexOf("PID") > - 1 ? Convert.ToInt32(Request.QueryString["PID"]) : 0;
            this.m_lineOrderId   = Request.QueryString.ToString().IndexOf("LID") > - 1 ? Convert.ToInt32(Request.QueryString["LID"]) : 0;
            this.m_report        = new OTCReport(this.m_reportId);
            this.m_startDate     = Convert.ToDateTime(Request.QueryString["STD"]);
            this.m_endDate       = Convert.ToDateTime(Request.QueryString["EDT"]);
            this.m_sortColumn    = Request.QueryString.ToString().IndexOf("sort")  > -1 ? Request.QueryString["sort"] : "";
            this.m_sortDirection = Request.QueryString.ToString().IndexOf("dir")  > -1 ? Request.QueryString["dir"] : "DESC";
            this.m_db.Open();

            string sql = this.m_report.SQL + " "
                + "@startDate = " + OTCDatabase.SqlFormat(this.m_startDate.ToShortDateString())+ ","
                + "@endDate = " + OTCDatabase.SqlFormat(this.m_endDate.ToShortDateString())
                ;

            //bool bla = (report.ReportRestrictions & (int)EDGAReport.Restriction.PartnerSpecific) > 0;

            //if((this.m_report.ReportRestrictions & (int)EDGAReport.Restriction.PartnerSpecific) > 0 && this.m_partnerId > 0)
            //	sql += ", @partnerId = " + this.m_partnerId;
            //if((this.m_report.ReportRestrictions & (int)EDGAReport.Restriction.LineOrderSpecific) > 0 && this.m_lineOrderId > 0)
            //	sql += ", @lineOrderNumber = " + this.m_lineOrderId;

            DataTable dt = this.m_db.GetDataset(sql,3600).Tables[0];
            this.m_db.ReleaseConnection();
            //this.m_page.PageMenu = this.buildMenu();
            //this.m_page.MainMenuVisible = true;
            this.m_page.CheckLogin();

            if(!(this.m_isCSV))
            {
                this.m_page.OpenHeader();
                this.m_page.CloseHeader();
                this.m_page.Start();
            }

            //Complete hack. I need to fix this.
            string genericFilter = dt.Columns.Contains("Order Number") ? "[Order Number] > 0" : "[SortEm] > 0";

            if(this.m_sortColumn.Length > 0)
                rows = dt.Select(genericFilter, this.m_sortColumn + " " + this.m_sortDirection);
            else
                rows = dt.Select();

            if(this.m_isCSV)
                this.buildExcelFile(dt,rows);
            else
                this.buildGrid(dt,rows);

            if(!(this.m_isCSV))
                this.m_page.End();

            Response.End();
        }
コード例 #3
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            this.m_page = new ITCPage();
            this.m_page.HideWest = true;

            if(!(this.m_page.CheckLogin()))
                Response.Redirect("/interceuticals/admin/login.aspx");

            if(!Page.IsPostBack)
            {
                this.m_thread = Request.QueryString.ToString().IndexOf("thread") > - 1 ? Request.QueryString["thread"] : "";
                switch(this.m_thread)
                {
                    case "AC":
                        OTCDatabase db = new OTCDatabase();
                        db.Open();
                        int reportId = Convert.ToInt32(db.GetDataset("SELECT EngagementReportId FROM EngagementReport WHERE SQL = 'spGetReport_CoordinatorDocument'").Tables[0].Rows[0]["EngagementReportId"]);
                        db.ReleaseConnection();
                        string lineOrderNumber = Request.QueryString["LON"];
                        Response.Write(reportId + " " + lineOrderNumber);
                        Response.Redirect("default.aspx?RID=" + reportId + "&LON=" + lineOrderNumber);
                        break;
                }

                DateTime startDate  = Convert.ToDateTime(System.DateTime.Now.Month.ToString() + "/1/" + System.DateTime.Now.Year.ToString());
                DateTime endDate    = System.DateTime.Now.AddDays(1);
                this.txtReportTypeId.Value = Request.QueryString["RID"];
                OTCReport report = new OTCReport(Convert.ToInt32(Request.QueryString["RID"]));
                this.lblReportHeader.Text = report.OTCReportName;
                this.lblDescription.Text = report.OTCReportDescription;
                this.cldStartDate.VisibleDate = startDate;
                this.cldEndDate.VisibleDate = endDate;
                this.cldStartDate.SelectedDate = startDate;
                this.cldEndDate.SelectedDate = endDate;
                ///his.ddLineOrders.Visible = false;
                //this.ddPartner.Visible = false;

                string strCookieValue = "";

                //Grab the cookie
                HttpCookie cookie = Request.Cookies["ExportToExcel"];

                //Check to make sure the cookie exists
                if (null != cookie)
                {
                    //Write the cookie value
                    strCookieValue = cookie.Value.ToString();
                }
                if(strCookieValue == "true")
                    this.chkExport.Checked = true;

                /*
                if((report.ReportRestrictions & (int)EDGAReport.Restriction.PartnerSpecific) > 0)
                {
                    this.ddPartner.Visible = true;
                    this.ddPartner.Fill();
                }

                if((report.ReportRestrictions & (int)EDGAReport.Restriction.LineOrderSpecific) > 0)
                {
                    this.ddLineOrders.Visible = true;
                    this.ddLineOrders.Fill();
                    if(Request.QueryString.ToString().IndexOf("LON") > - 1){
                        string lineOrderNumber = Request.QueryString["LON"];
                        this.ddLineOrders.SetActiveItem(lineOrderNumber);
                        this.ddLineOrders.Enabled = false;
                        BTG.ITPaper.BTGLineOrder lineOrder = new BTG.ITPaper.BTGLineOrder(Convert.ToInt32(lineOrderNumber));
                        this.cldStartDate.VisibleDate = lineOrder.StartDate;
                        this.cldEndDate.VisibleDate = System.DateTime.Now;
                        this.cldStartDate.SelectedDate = lineOrder.StartDate;
                        this.cldEndDate.SelectedDate = System.DateTime.Now;
                    }
                }
                */
            }
        }