private void LoadData()
    {
        string sFrom = Request.QueryString["datefrom"].ToString();
        string sTo   = Request.QueryString["dateto"].ToString();

        lblDateFrom.Text = sFrom;
        lblDateTo.Text   = sTo;

        DataTable dtbOverview = new DataTable();

        dtbOverview.Columns.Add("ProductID", typeof(int));
        dtbOverview.Columns.Add("ProductCategoryName", typeof(string));
        dtbOverview.Columns.Add("Price", typeof(double));
        dtbOverview.Columns.Add("ProductName", typeof(string));
        dtbOverview.Columns.Add("Number", typeof(int));
        dtbOverview.Columns.Add("Total", typeof(double));
        dtbOverview.Columns.Add("Date_Create", typeof(string));
        dtbOverview.Columns.Add("FullName", typeof(string));
        dtbOverview.Columns.Add("Phone", typeof(string));
        dtbOverview.Columns.Add("Address", typeof(string));

        Invoice   objInvoice = new Invoice();
        DataTable dtbInvoice = new DataTable();

        InvoiceDetails obj = new InvoiceDetails();
        DataTable      dtb = new DataTable();

        dtb = obj.ReportbyDate(sFrom, sTo);
        int nCount = dtb.Rows.Count;

        for (int i = 0; i < nCount; i++)
        {
            string nInvoiceID = dtb.Rows[i]["InvoiceID"].ToString();

            string sDate  = dtb.Rows[i]["Date_Create"].ToString();
            int    UserID = Convert.ToInt32(dtb.Rows[i]["UserID"]);

            string sName    = dtb.Rows[i]["FullName"].ToString();
            string sAddress = dtb.Rows[i]["Address"].ToString();
            string sPhone   = dtb.Rows[i]["Phone"].ToString();

            dtbInvoice = objInvoice.getMultipleID(nInvoiceID);
            int nCountInvoice = dtbInvoice.Rows.Count;

            for (int j = 0; j < nCountInvoice; j++)
            {
                int    nNumber       = Convert.ToInt32(dtbInvoice.Rows[j]["Number"]);
                double dTotal        = Convert.ToDouble(dtbInvoice.Rows[j]["Total"]);
                int    nProductID    = Convert.ToInt32(dtbInvoice.Rows[j]["ProductID"]);
                string sProductName  = dtbInvoice.Rows[j]["ProductName"].ToString();
                double fPrice        = Convert.ToDouble(dtbInvoice.Rows[j]["Price"]);
                string sCategoryName = dtbInvoice.Rows[j]["ProductCategoryName"].ToString();

                dtbOverview.Rows.Add(nProductID, sCategoryName, fPrice, sProductName, nNumber, dTotal, sDate, sName, sPhone, sAddress);
            }
        }

        rptReportSale.DataSource = dtbOverview;
        rptReportSale.DataBind();
    }
Beispiel #2
0
    private void LoadData()
    {
        string sFrom = Request.QueryString["datefrom"].ToString();
        string sTo   = Request.QueryString["dateto"].ToString();

        lblDateFrom.Text = sFrom;
        lblDateTo.Text   = sTo;



        InvoiceDetails obj = new InvoiceDetails();
        DataTable      dtb = new DataTable();

        //string sto= Convert.ToDateTime(sTo).ToString("ddMMyyyy");
        //string from = Convert.ToDateTime(sFrom).ToString("ddMMyyyy");
        dtb = obj.ReportbyDate(sFrom, sTo);

        rptProduct.DataSource = dtb;
        rptProduct.DataBind();
    }