Example #1
0
    protected void btnget_Click(object sender, EventArgs e)
    {
        string from = txtfromDate.Text.Split('/')[2] + "/" + txtfromDate.Text.Split('/')[1] + "/" + txtfromDate.Text.Split('/')[0];
        string To   = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0];

        fdate = Convert.ToDateTime(from);
        tdate = Convert.ToDateTime(To);
        if (fdate > tdate)
        {
            MessageBox("From Date is Greater than ToDate");
            txtfromDate.Focus();
        }
        else
        {
            if (RdbtnSelect.SelectedValue == "Bookwise")
            {
                string    Bookcode = txtbkcod.Text.ToString().Split(':')[0].Trim();
                DataTable dt       = new DataTable();
                dt = Books.Get_BookwiseCust_summary(fdate, tdate, Bookcode, Convert.ToInt32(strFY), Convert.ToInt32(DDLSuperZone.SelectedValue), Convert.ToInt32(DDLZone.SelectedValue)).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    ViewState["PendingQty"] = dt;
                    getdata(dt);
                }
                else
                {
                    MessageBox("No Records Found");
                    txtfromDate.Focus();
                }
            }
            if (RdbtnSelect.SelectedValue == "BookTypewise")
            {
                string    BookTypecode = txtbktype.Text.ToString().Split(':')[0].Trim();
                DataTable dt1          = new DataTable();
                dt1 = Books.Get_BooktypewiseCust_summary(fdate, tdate, BookTypecode, Convert.ToInt32(strFY), Convert.ToInt32(DDLSuperZone.SelectedValue), Convert.ToInt32(DDLZone.SelectedValue)).Tables[0];
                if (dt1.Rows.Count > 0)
                {
                    ViewState["PendingQty"] = dt1;
                    getdata(dt1);
                }
                else
                {
                    if (txtbktype.Text == "")
                    {
                        MessageBox("Enter Book Type");
                        txtbktype.Focus();
                    }
                    else
                    {
                        MessageBox("No Records Found");
                        RdbtnSelect.Focus();

                        txtbkcod.Text  = "";
                        txtbktype.Text = "";
                    }
                }
            }
        }
        // getdata();
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["FY"] != null)
        {
            strFY = Session["FY"].ToString();
        }
        else
        {
            Session.Clear();
        }


        if (!Page.IsPostBack)
        {
            RdbtnSelect.Focus();
            ViewState["PendingQty"] = null;
            lblbkt.Visible          = false;
            txtbktype.Visible       = false;
            Bind_DDL_SuperZone();
        }
        if (IsPostBack)
        {
            //    Bind();
            if (ViewState["PendingQty"] != null)
            {
                getdata((DataTable)ViewState["PendingQty"]);
            }
        }
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ConfigurationManager.AppSettings["access"].ToString() != ConfigurationManager.AppSettings["accessok"].ToString())
        {
            string page = Request.Url.Segments[Request.Url.Segments.Length - 1].ToString();
            if (Session["Role"] != null)
            {
                if (!Other.Get_UserAccess(page, Session["Role"].ToString()))
                {
                    Response.Redirect("dashboard.aspx");
                }
            }
        }
        if (Session["ChetanaCompanyName"] != null)
        {
            if (Session["FY"] != null)
            {
                strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
                strFY = Session["FY"].ToString();
            }
            else
            {
                Session.Clear();
            }
            //Response.Write(strFY);
        }

        if (!Page.IsPostBack)
        {
            ViewState["Bkwise"] = null;
            RdbtnSelect.Focus();
            //lblbk.Visible = false;
            //txtbkcod.Visible = false;
            lblbkt.Visible    = false;
            txtbktype.Visible = false;
            pnlZone.Visible   = false;
            rdobtn.Visible    = false;
            //txtfromDate.Text = Session["FromDate"].ToString();
            //txttoDate.Text = Session["ToDate"].ToString();
            Bind_DDL_SuperDuperZone();
        }
        if (IsPostBack)
        {
            if (ViewState["Bkwise"] != null && rdobtn.SelectedValue == "Quantitywise")
            {
                getdata((DataTable)ViewState["Bkwise"]);
            }
            if (ViewState["Bkwise"] != null && rdobtn.SelectedValue == "AmountWise")
            {
                BindData();
            }
            //txtfromDate.Text = Session["FromDate"].ToString();
            //txttoDate.Text = Session["ToDate"].ToString();
        }
    }
Example #4
0
    protected void btnget_Click(object sender, EventArgs e)
    {
        string from = txtfromDate.Text.Split('/')[2] + "/" + txtfromDate.Text.Split('/')[1] + "/" + txtfromDate.Text.Split('/')[0];
        string To   = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0];

        fdate = Convert.ToDateTime(from);
        tdate = Convert.ToDateTime(To);
        if (fdate > tdate)
        {
            MessageBox("From Date is Greater than ToDate");
            txtfromDate.Focus();
        }
        else
        {
            if (RdbtnSelect.SelectedValue == "Bookwise")
            {
                string    Bookcode = txtbkcod.Text.ToString().Split(':')[0].Trim();
                DataTable dt       = new DataTable();
                dt = Books.Get_Bookwise_summary(fdate, tdate, Bookcode, Convert.ToInt32(strFY)).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    ViewState["Bkwise"] = dt;
                    getdata(dt);
                    //ReportDocument CR = new ReportDocument();
                    //CR.Load(Server.MapPath("Report/Bookwise_Summary.rpt"));
                    //CrptBookwiseSummary.SeparatePages = false;
                    //CR.SetDataSource(dt);
                    //CrptBookwiseSummary.ReportSource = CR;
                }
                else
                {
                    MessageBox("No Records Found");
                    txtfromDate.Focus();
                }

                // txtbkcod.Text = "";
                // txtbktype.Text = "";
            }
            if (RdbtnSelect.SelectedValue == "BookTypewise")
            {
                string    BookTypecode = txtbktype.Text.ToString().Split(':')[0].Trim();
                DataTable dt1          = new DataTable();
                dt1 = Books.Get_Booktypewise_summary(BookTypecode, fdate, tdate, Convert.ToInt32(strFY)).Tables[0];
                if (dt1.Rows.Count > 0)
                {
                    ViewState["Bkwise"] = dt1;
                    getdata(dt1);
                    //ReportDocument CR = new ReportDocument();
                    //CR.Load(Server.MapPath("Report/Booktypewise_Summary.rpt"));
                    //CrptBookwiseSummary.SeparatePages = false;
                    //CR.SetDataSource(dt1);
                    //CrptBookwiseSummary.ReportSource = CR;

                    //txtbkcod.Text = "";
                    //txtbktype.Text = "";
                }
                else
                {
                    MessageBox("No Records Found");
                    RdbtnSelect.Focus();
                    //  txtbkcod.Text = "";
                    //   txtbktype.Text = "";
                }
            }
        }
    }
Example #5
0
    public void BindData()
    {
        string from = txtfromDate.Text.Split('/')[2] + "/" + txtfromDate.Text.Split('/')[1] + "/" + txtfromDate.Text.Split('/')[0];
        string To   = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0];

        fdate = Convert.ToDateTime(from);
        tdate = Convert.ToDateTime(To);
        int szone, zone;

        if (ddlSDZone.SelectedIndex == 0)
        {
            szone = zone = 0;
        }
        else
        if (DDLSuperZone.SelectedIndex == 0)
        {
            szone = Convert.ToInt32(DDLSuperZone.SelectedValue.ToString());
            zone  = 0;
        }
        else
        {
            if (DDLSuperZone.SelectedIndex == -1)
            {
                szone = 0;
            }
            else
            {
                szone = Convert.ToInt32(DDLSuperZone.SelectedValue.ToString());
            }

            if (DDLZone.SelectedIndex == -1)
            {
                zone = 0;
            }
            else
            {
                zone = Convert.ToInt32(DDLZone.SelectedValue.ToString());
            }
        }

        if (fdate > tdate)
        {
            MessageBox("From Date is Greater than ToDate");
            txtfromDate.Focus();
        }
        else
        {
            string  BookTypecode = txtbktype.Text.ToString().Split(':')[0].Trim();
            DataSet ds           = new DataSet();
            ds = OtherClass.Idv_Chetana_Rep_Booktypewise_A_Report(BookTypecode, fdate, tdate, Convert.ToInt32(ddlSDZone.SelectedValue.ToString()), szone, zone, Convert.ToInt32(strFY));

            //ds = OtherClass.Idv_Chetana_Rep_Booktypewise_A_Report(BookTypecode, fdate, tdate, ddlSDZone.SelectedValue.ToString(), DDLSuperZone.SelectedValue.ToString(), DDLZone.SelectedValue.ToString(), Convert.ToInt32(strFY));
            if (ds.Tables[0].Rows.Count > 0)
            {
                ViewState["Bkwise"] = ds.Tables[0];
                ReportDocument CR = new ReportDocument();
                CR.Load(Server.MapPath("Report/Booktypewise_Amt_Summary.rpt"));
                CrptBookwiseSummary.SeparatePages = true;
                CR.SetDataSource(ds.Tables[0]);
                CrptBookwiseSummary.ReportSource = CR;

                //                txtbkcod.Text = "";
                // txtbktype.Text = "";
            }
            else
            {
                MessageBox("No Records Found");
                RdbtnSelect.Focus();
                //  txtbkcod.Text = "";
                //   txtbktype.Text = "";
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ConfigurationManager.AppSettings["access"].ToString() != ConfigurationManager.AppSettings["accessok"].ToString())
        {
            string page = Request.Url.Segments[Request.Url.Segments.Length - 1].ToString();
            if (Session["Role"] != null)
            {
                if (!Other.Get_UserAccess(page, Session["Role"].ToString()))
                {
                    Response.Redirect("dashboard.aspx");
                }
            }
        }
        if (Session["ChetanaCompanyName"] != null)
        {
            if (Session["FY"] != null)
            {
                strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
                strFY = Session["FY"].ToString();
            }
            else
            {
                Session.Clear();
            }
            //Response.Write(strFY);
        }
        if (!Page.IsPostBack)
        {
            BindSuperZone();
            RdbtnSelect.Focus();

            //lblbk.Visible = false;
            //txtbkcod.Visible = false;

            lblbkt.Visible    = false;
            txtbktype.Visible = false;
        }
        if (IsPostBack)
        {
            if (RdbtnSelect.SelectedValue == "Bookwise")
            {
                DDLsuperzone.Focus();

                lblbk.Visible    = true;
                txtbkcod.Visible = true;

                lblbkt.Visible    = false;
                txtbktype.Visible = false;

                if (txtfromDate.Text != "" || txttoDate.Text != "")
                {
                    getdata();
                }
            }
            if (RdbtnSelect.SelectedValue == "BookTypewise")
            {
                DDLsuperzone.Focus();

                lblbk.Visible    = false;
                txtbkcod.Visible = false;

                lblbkt.Visible    = true;
                txtbktype.Visible = true;

                if (txtfromDate.Text != "" || txttoDate.Text != "")
                {
                    getdata();
                }
            }
        }
    }
    public void getdata()
    {
        string from = txtfromDate.Text.Split('/')[2] + "/" + txtfromDate.Text.Split('/')[1] + "/" + txtfromDate.Text.Split('/')[0];
        string To   = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0];

        fdate = Convert.ToDateTime(from);
        tdate = Convert.ToDateTime(To);
        int SupID = Convert.ToInt32(DDLsuperzone.SelectedValue);

        if (fdate > tdate)
        {
            MessageBox("From Date is Greater than ToDate");
            txtfromDate.Focus();
        }
        else
        {
            if (RdbtnSelect.SelectedValue == "Bookwise")
            {
                string    Bookcode = txtbkcod.Text.ToString().Split(':')[0].Trim();
                DataTable dt       = new DataTable();
                dt = Books.Get_Bookwise_ZonalDetail(Convert.ToInt32(DDLsuperzone.SelectedValue), fdate, tdate, Bookcode, Convert.ToInt32(strFY)).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    ReportDocument CR = new ReportDocument();
                    CR.Load(Server.MapPath("Report/Bookwise_ZonalDetail.rpt"));

                    CR.SetDataSource(dt);
                    CrptBkwiseZonald.ReportSource = CR;
                }
                else
                {
                    MessageBox("No Records Found");
                    DDLsuperzone.Focus();
                }

                //  txtbkcod.Text = "";
                //  txtbktype.Text = "";
                //   DDLsuperzone.SelectedIndex = 0;
            }
            if (RdbtnSelect.SelectedValue == "BookTypewise")
            {
                string    BookTypecode = txtbktype.Text.ToString().Split(':')[0].Trim();
                DataTable dt1          = new DataTable();
                dt1 = Books.Get_Booktypewise_ZonalDetail(Convert.ToInt32(DDLsuperzone.SelectedValue), fdate, tdate, BookTypecode, Convert.ToInt32(strFY)).Tables[0];

                if (dt1.Rows.Count > 0)
                {
                    ReportDocument CR = new ReportDocument();
                    CR.Load(Server.MapPath("Report/Booktypewise_ZonalDetail.rpt"));

                    CR.SetDataSource(dt1);
                    CrptBkwiseZonald.ReportSource = CR;

                    //  txtbkcod.Text = "";
                    //  txtbktype.Text = "";
                    //  DDLsuperzone.SelectedIndex = 0;
                }
                else
                {
                    if (txtbktype.Text == "")
                    {
                        MessageBox("Enter Book Type");
                        txtbktype.Focus();
                    }
                    else
                    {
                        MessageBox("No Records Found");
                        RdbtnSelect.Focus();

                        //      txtbkcod.Text = "";
                        //     txtbktype.Text = "";
                        //     DDLsuperzone.SelectedIndex = 0;
                    }
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ConfigurationManager.AppSettings["access"].ToString() != ConfigurationManager.AppSettings["accessok"].ToString())
        {
            string page = Request.Url.Segments[Request.Url.Segments.Length - 1].ToString();
            if (Session["Role"] != null)
            {
                if (!Other.Get_UserAccess(page, Session["Role"].ToString()))
                {
                    Response.Redirect("dashboard.aspx");
                }
            }
        }
        if (Session["ChetanaCompanyName"] != null)
        {
            if (Session["FY"] != null)
            {
                strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
                strFY = Session["FY"].ToString();
            }
            else
            {
                Session.Clear();
            }
        }

        if (IsPostBack)
        {
            if (RdbtnSelect.SelectedValue == "BookTypewise")
            {
                if (Convert.ToInt32(ddlSDZone.SelectedValue) == 0 || txtbktype.Text == "" || txtfromDate.Text == "" || txttoDate.Text == "")
                {
                }
                else
                {
                    Bind();
                }
            }
            else
            {
                if (Convert.ToInt32(ddlSDZone.SelectedValue) == 0 || txtbkcod.Text == "" || txtfromDate.Text == "" || txttoDate.Text == "")
                {
                }
                else
                {
                    Bind();
                }
            }
        }

        if (!Page.IsPostBack)
        {
            GetDates();
            ddlSDZone.Focus();
            Bind_DDl_SDZone();
            ViewState["Bkwise"] = null;
            RdbtnSelect.Focus();
            //lblbk.Visible = false;
            //txtbkcod.Visible = false;

            lblbkt.Visible    = false;
            txtbktype.Visible = false;
        }
        txtbkcod.Focus();
    }