Example #1
0
 protected void btnGo_Click(object sender, EventArgs e)
 {
     try
     {
         if (Page.IsPostBack)
         {
             lblMess.Text = "No Records Found!";
             gv_Report.Dispose();
             gv_Report.DataBind();
         }
         string DateFrom = txt_Date.Text.Length > 0 ? txt_Date.Text : "0";
         string DateTo = txt_DateTo.Text.Length > 0 ? txt_DateTo.Text : "0";
         DataSet ds = TransactionBOL.Select_Report_tbl_Digitalkasos(DateFrom, DateTo);
         if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             Btn_Excel.Enabled = true;
             btnPrint.Disabled = false;
             gv_Report.DataSource = ds;
             lblMess.Text = "";
         }
         else
         {
             btnPrint.Disabled = true;
             Btn_Excel.Enabled = false;
             lblMess.Text = "No Records Found!";
         }
         gv_Report.DataBind();
     }
     catch (Exception ex)
     {
         Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(ex.Message);
     }
 }