private void BindListBySearchParameters(CountryListUI countryListUI) { try { DataTable dtb = countryListBAL.GetCountryListBySearchParameters(this.countryListUI); if (dtb.Rows.Count > 0 && dtb != null) { gvData.DataSource = dtb; gvData.DataBind(); divError.Visible = false; gvData.Visible = true; } else { divError.Visible = true; lblError.Text = Resources.GlobalResource.msgNoRecordFound; gvData.Visible = false; } txtSearch.Text = ""; txtSearch.Focus(); } catch (Exception exp) { logExcpUIobj.MethodName = "BindListBySearchParameters()"; logExcpUIobj.ResourceName = "System_Settings_CountryList.CS"; logExcpUIobj.RecordId = "All"; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[System_Settings_CountryList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } }
public void SearchCountryList() { try { CountryListUI countryListUI = new CountryListUI(); countryListUI.Search = txtCountrySearch.Text; DataTable dtb = countryListBAL.GetCountryListBySearchParameters(countryListUI); if (dtb.Rows.Count > 0 && dtb != null) { gvCountrySearch.DataSource = dtb; gvCountrySearch.DataBind(); divCountrySearchError.Visible = false; } else { divCountrySearchError.Visible = true; lblCountrySearchError.Text = Resources.GlobalResource.msgNoRecordFound; gvCountrySearch.Visible = false; } } catch (Exception exp) { logExcpUIobj.MethodName = "SearchCountryList()"; logExcpUIobj.ResourceName = "System_Settings_BankForm.CS"; logExcpUIobj.RecordId = "All"; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[System_Settings_BankForm : SearchCountryList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } }
public DataTable GetCountryListBySearchParameters(CountryListUI countryListUI) { DataTable dtb = new DataTable(); dtb = countryListDAL.GetCountryListBySearchParameters(countryListUI); return(dtb); }
public int DeleteCountry(CountryListUI countryListUI) { int result = 0; result = countryListDAL.DeleteCountry(countryListUI); return(result); }
public DataTable GetCountryListById(CountryListUI countryListUI) { DataTable dtb = new DataTable(); dtb = countryListDAL.GetCountryListById(countryListUI); return(dtb); }
public DataTable GetCountryListById(CountryListUI countryListUI) { DataSet ds = new DataSet(); DataTable dtbl = new DataTable(); try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SqlCommand sqlCmd = new SqlCommand("SP_Country_SelectById", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_CountryId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_CountryId"].Value = countryListUI.Tbl_CountryId; using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd)) { adapter.Fill(ds); } } if (ds.Tables.Count > 0) { dtbl = ds.Tables[0]; } } catch (Exception exp) { logExcpUIobj.MethodName = "getCountryListById()"; logExcpUIobj.ResourceName = "CountryListDAL.CS"; logExcpUIobj.RecordId = countryListUI.Tbl_CountryId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[CountryListDAL : getCountryListById] An error occured in the processing of Record Id : " + countryListUI.Tbl_CountryId + ". Details : [" + exp.ToString() + "]"); } finally { ds.Dispose(); } return(dtbl); }
public int DeleteCountry(CountryListUI countryListUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_Country_Delete", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_CountryId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_CountryId"].Value = countryListUI.Tbl_CountryId; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "DeleteCountry()"; logExcpUIobj.ResourceName = "CountryListDAL.CS"; logExcpUIobj.RecordId = "Search = " + countryListUI.Search; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[CountryListDAL : DeleteCountry] An error occured in the processing of Record Search = " + countryListUI.Search + " . Details : [" + exp.ToString() + "]"); } return(result); }