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]; fdt = Convert.ToDateTime("1900/01/01"); tdt = Convert.ToDateTime("1900/01/01"); // Rptrpending.DataSource = CreditNote.GetCNNo_byCust(Convert.ToInt32(DDLCustomer.SelectedValue)); //RptrCN.DataSource = CreditNote.GetCNNo_byCust(Convert.ToInt32(strFY), (DDLCustomer.SelectedValue), "All", fdt, tdt); //RptrCN.DataBind(); Chkbxlstcn.DataSource = CreditNote.GetCNNo_byCust(Convert.ToInt32(strFY), (DDLCustomer.SelectedValue), "All", fdt, tdt); Chkbxlstcn.DataBind(); Chkbxlstcn.Items.Insert(0, new ListItem("All", "0")); //RptrCN2.DataSource = CreditNote.GetCNNo_byCust((DDLCustomer.SelectedValue), "Manual"); //RptrCN2.DataBind(); //RptrCN.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; } }
protected void btngetcust_Click(object sender, EventArgs e) { Pnl2.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]; tdt = Convert.ToDateTime(todate); fdt = Convert.ToDateTime(frdate); if (tdt >= fdt) { if (RdbtnSelect.SelectedValue == "CN") { Pnl1.Visible = false; //RptrCN.DataSource = CreditNote.GetCNNo_Bydt(Convert.ToInt32(strFY), fdt, tdt); //RptrCN.DataBind(); //RptrCN.Visible = true; Chkbxlstcn.DataSource = CreditNote.GetCNNo_Bydt(Convert.ToInt32(strFY), fdt, tdt); Chkbxlstcn.DataBind(); Chkbxlstcn.Items.Insert(0, new ListItem("All", "0")); Pnl2.Visible = true; } if (RdbtnSelect.SelectedValue == "CustomerwiseCN") { DataSet ds = new DataSet(); // ds = CreditNote.GetCustlist_Bydt(Convert.ToInt32(strFY), fdt, tdt); ds = ObjotherZ.Idv_Chetana_DC_GetCustlist_Bydt(Convert.ToInt32(strFY), fdt, tdt, UserName, "", ""); 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")); Chkbxlstcn.Items.Insert(0, new ListItem("All", "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"); //} }