Ejemplo n.º 1
0
    protected void btngetcust_Click(object sender, EventArgs e)
    {
        Pnl2.Visible     = false;
        PnlAddbk.Visible = false;
        btn_Save.Visible = false;
        PnlPrint.Visible = false;
        btnPrint.Visible = false;

        frdate = txtFromDate.Text.Split('/')[2] + "/" + txtFromDate.Text.Split('/')[1] + "/" + txtFromDate.Text.Split('/')[0];
        todate = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0];

        fdt = Convert.ToDateTime(frdate);
        tdt = Convert.ToDateTime(todate);

        if (tdt >= fdt)
        {
            if (RdbtnSelect.SelectedValue == "CN")
            {
                Pnl1.Visible = false;

                RptrCN2.DataSource = CreditNote.GetCNNo_Bydt(Convert.ToInt32(strFY), fdt, tdt);
                RptrCN2.DataBind();

                RptrCN2.Visible = true;
                // RptrCN2.Visible = true;
                PnlPrint.Visible = false;
                Pnl2.Visible     = true;
                PnlAddbk.Visible = false;
            }
            if (RdbtnSelect.SelectedValue == "CustomerwiseCN")
            {
                DataSet ds = new DataSet();
                ds = CreditNote.GetCustlist_Bydt(Convert.ToInt32(strFY), fdt, tdt);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DDLCustomer.DataSource = CreditNote.GetCustlist_Bydt(Convert.ToInt32(strFY), fdt, tdt);
                    DDLCustomer.DataBind();
                    DDLCustomer.Items.Insert(0, new ListItem("-Select Customer-", "0"));
                    Pnl1.Visible = true;
                }
                else
                {
                    MessageBox("Records Not Available ");
                }
            }
        }
        else
        {
            MessageBox("From Date is greater than To Date");
        }
        //else
        //if (Convert.ToDateTime(todate) == Convert.ToDateTime(frdate))
        //{
        //    MessageBox("From Date and To Date are similar");

        //}
        DDLCustomer.Focus();
    }