Пример #1
0
 protected void gvBalance_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "View")
     {
         // GridViewRow rw = (GridViewRow)(((Control)e.CommandSource).NamingContainer);
         // Label lblTaskName = (Label)rw.FindControl("lblTaskName");
         DataSet dsTransaction = null;
         try
         {
             dsTransaction = objService.TransactionBetweenDates(null, null, Convert.ToInt32(Session["CustomerId"]), ddlBank.SelectedValue);
             if (dsTransaction != null)
             {
                 if (dsTransaction.Tables[0] != null)
                 {
                     if (dsTransaction.Tables[0].Rows.Count > 0)
                     {
                         Session["AllTransaction"] = dsTransaction.Tables[0];
                         gvTransaction.DataSource  = dsTransaction.Tables[0];
                         gvTransaction.DataBind();
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             throw;
         }
         finally
         {
         }
     }
 }
 protected void btnView_Click(object sender, EventArgs e)
 {
     try
     {
         DataSet dsTransaction = objService.TransactionBetweenDates(Convert.ToDateTime(txtStartdate.Text), Convert.ToDateTime(txtEnddate.Text), Convert.ToInt32(Session["CustomerId"].ToString()), Session["BankID"].ToString());
         if (dsTransaction.Tables[0].Rows.Count > 0)
         {
             gvExport.DataSource = dsTransaction.Tables[0];
             gvExport.DataBind();
             btnExcelExport.Visible = true;
             btnPdfExport.Visible   = true;
         }
     }
     catch (Exception ex)
     {
     }
     finally
     {
     }
 }