예제 #1
0
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         //ClearFields();
         Response.Cookies[Constants.IsUpdate].Expires = DateTime.Now;
         lblerror.Text   = string.Empty;
         lblSuccess.Text = string.Empty;
         string  sUserCode    = Convert.ToString(Request.Cookies[Constants.UserCode].Value);
         string  sCompanyCode = Convert.ToString(Request.Cookies[Constants.CompanyCode].Value);
         DataSet sResult      = oTimeEntry.SearchFileReference(txtVessel.Text, ddlClubSearch.SelectedValue, txtMember.Text, txtFileRefSearch.Text, txtClaimHandlerSearch.Text, txtYearSearch.Text, sUserCode, sCompanyCode);
         if (sResult != null && sResult.Tables[0].Rows.Count > 0)
         {
             ViewState["SearchResult"] = sResult.Tables[0];
             ViewState["sortOrder"]    = "";
             BindGridView("", "");
         }
         else
         {
             lblerror.Visible = true;
             lblerror.Text    = "Search result doesnot exist";
             grvSearch.DataBind();
         }
         //}
     }
     catch (Exception ex)
     {
         lblerror.Visible = true;
         lblerror.Text    = ex.Message.ToString();
     }
 }