Exemplo 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();
    }
Exemplo n.º 2
0
    protected void Btnno_Click(object sender, EventArgs e)
    {
        RptrCN2.DataSource = CreditNote.GetCNNo_byCusts(Convert.ToInt32(strFY), (Txtlrnos.Text), "LR");
        RptrCN2.DataBind();

        //RptrCN2.DataSource = CreditNote.GetCNNo_byCust((DDLCustomer.SelectedValue), "Manual");
        //RptrCN2.DataBind();

        RptrCN2.Visible = true;
        // RptrCN2.Visible = true;
        Pnl2.Visible = true;
    }
Exemplo n.º 3
0
    protected void DDLCustomer_SelectedIndexChanged(object sender, EventArgs e)
    {
        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];

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

        // Rptrpending.DataSource = CreditNote.GetCNNo_byCust(Convert.ToInt32(DDLCustomer.SelectedValue));
        RptrCN2.DataSource = CreditNote.GetCNNo_byCust(Convert.ToInt32(strFY), (DDLCustomer.SelectedValue), "All", fdt, tdt);
        RptrCN2.DataBind();

        //RptrCN2.DataSource = CreditNote.GetCNNo_byCust((DDLCustomer.SelectedValue), "Manual");
        //RptrCN2.DataBind();

        RptrCN2.Visible = true;
        // RptrCN2.Visible = true;
        Pnl2.Visible = true;

        //DataTable dt = new DataTable();
        //dt = DCReturnBook.GetCustAddress((DDLCustomer.SelectedValue), "CNCustlist").Tables[0];
        //if (dt.Rows.Count > 0)
        //{
        //    lblCustName.Text = dt.Rows[0]["CustName"].ToString();
        //    lblCustAddress.Text = dt.Rows[0]["Address"].ToString();
        //}

        if (DDLCustomer.SelectedIndex == 0)
        {
            Pnl2.Visible = false;
        }
        PnlAddbk.Visible = false;
        btn_Save.Visible = false;
        PnlPrint.Visible = false;
        btnPrint.Visible = false;
        Pnl2.Focus();
    }