public void ShowDetails()
    {
        //string from = txtfromDate.Text.Split('/')[1] + "/" + txtfromDate.Text.Split('/')[0] + "/" + txtfromDate.Text.Split('/')[2];
        //string To = txtToDate.Text.Split('/')[1] + "/" + txtToDate.Text.Split('/')[0] + "/" + txtToDate.Text.Split('/')[2];
        //fdate = Convert.ToDateTime(from);
        //tdate = Convert.ToDateTime(To);
        if (fdate > tdate)
        {
            MessageBox("From Date is Greater than ToDate");
            txtfromDate.Focus();
        }
        else
        {
            DataSet ds = new DataSet();
            ds = Other.Dashboard.Get_Report_SalesPerformance(0, Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY), fdate, tdate);
            grdoutstanding.DataSource = ds.Tables[0];
            grdoutstanding.DataBind();
            grdnoofparty.DataSource = ds.Tables[0];
            grdnoofparty.DataBind();
            grdtargetdetail.DataSource = Other.Dashboard.Get_Report_SalesPerformance(0, Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY));
            grdtargetdetail.DataBind();



            GrdDiscount.DataSource = Other.Dashboard.Get_Report_SalesPerformanceForDiscountParties(Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY), fdate, tdate).Tables[0];
            GrdDiscount.DataBind();
            DataTable dt = new DataTable();
            dt = Other.Dashboard.Get_Report_SalesPerformanceForDiscountParties(Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY), fdate, tdate).Tables[1];

            //  DataTable dt = new DataTable();
            int     sum    = 0;
            DataRow newrow = dt.NewRow();
            foreach (DataColumn dc in dt.Columns)
            {
                sum = 0;
                foreach (DataRow dr in dt.Rows)
                {
                    sum += (int)dr[dc];
                }
                newrow[dc.ColumnName] = sum;
                //grdadddiscount.FooterRow.Cells.ToString()  = sum;
            }

            dt.Rows.Add(newrow);

            grdadddiscount.DataSource = dt;
            grdadddiscount.DataBind();
            //  grdadddiscount.Columns[0].Visible = false;
            GrdBookset.DataSource = Other.Dashboard.Get_Report_SalesPerformanceForBookSet(Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY), fdate, tdate);
            GrdBookset.DataBind();
            grdemployee.DataBind();
            grdcustomer.DataBind();

            lblgrdemployee.Text  = "";
            lblgrdcustomer.Text  = "";
            lblcustomername.Text = "";

            salesperformance.ReportSource = null;
        }
    }
Ejemplo n.º 2
0
    public void ShowDetails1()
    {
        stDS = new DataSet();
        stDS = Other.Dashboard.Get_Report_SalesPerformance(0, Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY), fdate, tdate);
        if (stDS.Tables[0].Rows.Count > 0)
        {
            DataView       dv = new DataView(stDS.Tables[0]);
            ReportDocument rd = new ReportDocument();
            rd.Load(Server.MapPath("Report/SalesPerformance.rpt"));
            rd.Database.Tables[0].SetDataSource(dv);
            DataSet ds = new DataSet();

            // ds = Other.Dashboard.Get_Report_SalesPerformance_Customer1(Convert.ToInt32(stDS.Tables[0].Rows[0]["ZoneId"]), Convert.ToInt32(strFY));

            //  rd.OpenSubreport("Customer").SetDataSource(ds.Tables[0]);

            salesperformance.ReportSource = rd;

            grdnoofparty.DataBind();
            grdoutstanding.DataBind();
            GrdDiscount.DataBind();
            GrdBookset.DataBind();
            grdemployee.DataBind();
            grdcustomer.DataBind();
            grdtargetdetail.DataBind();
            // grdadddiscount.DataSource = null;
            grdadddiscount.DataBind();
        }
        else
        {
            MessageBox("No Record Found");
        }
    }
Ejemplo n.º 3
0
    protected void grdoutstanding_RowEditing(object sender, GridViewEditEventArgs e)
    {
        string zoneid = ((Label)grdoutstanding.Rows[e.NewEditIndex].FindControl("lblzoneid")).Text;

        grdemployee.Visible = false;
        DataTable dt = new DataTable();

        dt = Other.Dashboard.Get_Report_SalesPerformance_OnEmployee(Convert.ToInt32(zoneid)).Tables[0];
        //grdemployee.DataSource = Other.Dashboard.Get_Report_SalesPerformance_OnEmployee(Convert.ToInt32(zoneid)).Tables[0];
        //grdemployee.DataBind();
        string from = txtfromDate.Text.Split('/')[1] + "/" + txtfromDate.Text.Split('/')[0] + "/" + txtfromDate.Text.Split('/')[2];
        string To   = txtToDate.Text.Split('/')[1] + "/" + txtToDate.Text.Split('/')[0] + "/" + txtToDate.Text.Split('/')[2];

        fdate = Convert.ToDateTime(from);
        tdate = Convert.ToDateTime(To);

        grdcustomer.DataBind();
        grdemployee.Visible = false;
        //    lblgrdcustomer.Text = "";
        if (dt.Rows.Count > 0)
        {   // lblname
            string    empid      = dt.Rows[0]["empid"].ToString();
            DataTable dtcustomer = new DataTable();
            dtcustomer             = Other.Dashboard.Get_Report_SalesPerformance_OnCustomer(Convert.ToInt32(zoneid), Convert.ToInt32(strFY), fdate, tdate).Tables[0];
            grdcustomer.DataSource = dtcustomer;
            grdcustomer.DataBind();
            grdcustomer.Focus();
            dtAll.Merge(dtcustomer);
            //  grdzonedetail.DataSource = Other.Dashboard.Get_Report_SalesPerformance_OnCustomer(Convert.ToInt32(empid), Convert.ToInt32(strFY), fdate, tdate).Tables[1];
            //   grdzonedetail.DataBind();
            DataTable dtbookSet = new DataTable();
            dtbookSet             = Other.Dashboard.Get_Report_SalesPerformanceForBookSet(Convert.ToInt32(zoneid), Convert.ToInt32(strFY), fdate, tdate).Tables[0];
            GrdBookset.DataSource = dtbookSet;
            GrdBookset.DataBind();
            dtAll.Merge(dtbookSet);
            if (grdcustomer.Rows.Count > 0)
            {
                lblgrdemployee.Text  = ((Label)grdoutstanding.Rows[e.NewEditIndex].FindControl("lblzonecode")).Text;
                lblgrdcustomer.Text  = dt.Rows[0]["empcode"].ToString();
                lblcustomername.Text = dt.Rows[0]["Empname"].ToString();
            }
            else
            {
                lblgrdcustomer.Text = "";
            }
            lblgrdemployee.Text = ((Label)grdoutstanding.Rows[e.NewEditIndex].FindControl("lblzonecode")).Text + " : ";
        }
        else
        {
            lblgrdemployee.Text = "";
        }
    }