Пример #1
0
 protected void btnGetDetails_Click(object sender, EventArgs e)
 {
     lblMessage.Text = "";
     try
     {
         DataTable dt = new DataTable();
         if (txtSearch.Text != "")
         {
             dt = obj_wallet.getBeneficiaryDetailByID(txtSearch.Text);
             if (dt.Rows.Count > 0)
             {
                 gvRegistration.DataSource = dt;
                 gvRegistration.DataBind();
             }
             else
             {
                 gvRegistration.DataSource = null;
                 gvRegistration.DataBind();
             }
         }
         else if (txtDate1.Text != "")
         {
             string date1 = txtDate1.Text;
             date1 = Convert.ToDateTime(date1).ToString("yyyy-MM-dd");
             string date2 = "";
             if (txtDate2.Text != "")
             {
                 date2 = txtDate2.Text;
                 date2 = Convert.ToDateTime(date2).ToString("yyyy-MM-dd");
             }
             dt = obj_wallet.getBeneficiaryDetailByDate(date1, date2);
             if (dt.Rows.Count > 0)
             {
                 gvRegistration.DataSource = dt;
                 gvRegistration.DataBind();
             }
             else
             {
                 gvRegistration.DataSource = null;
                 gvRegistration.DataBind();
             }
         }
         else
         {
             BindBeneficiaryDetails();
         }
     }
     catch (Exception ex)
     {
         lblMessage.Text = ex.Message;
     }
 }