private void BindListBySearchParameters(CurrencyListUI batchListUI) { try { DataTable dtb = currencyListBAL.GetCurrencyListBySearchParameters(this.currencyListUI); 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_CurrencyList.CS"; logExcpUIobj.RecordId = "All"; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[System_Settings_CurrencyList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } }
private void SearchCurrencyList() { try { CurrencyListUI currencyListUI = new CurrencyListUI(); currencyListUI.Search = txtCurrencySearch.Text; DataTable dtb = currencyListBAL.GetCurrencyListBySearchParameters(currencyListUI); if (dtb.Rows.Count > 0 && dtb != null) { gvCurrencySearch.DataSource = dtb; gvCurrencySearch.DataBind(); divCurrencySearchError.Visible = false; } else { divCurrencySearchError.Visible = true; lblCurrencySearchError.Text = Resources.GlobalResource.msgNoRecordFound; gvCurrencySearch.Visible = false; } } catch (Exception exp) { logExcpUIobj.MethodName = "SearchCurrencyList()"; logExcpUIobj.ResourceName = "Assets_Asset_AssetForm.CS"; logExcpUIobj.RecordId = "All"; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[Assets_Asset_AssetForm : SearchCurrencyList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } }
public int DeleteCurrency(CurrencyListUI currencyListUI) { int result = 0; result = currencyListDAL.DeleteCurrency(currencyListUI); return(result); }
public DataTable GetCurrencyListBySearchParameters(CurrencyListUI currencyListUI) { DataTable dtb = new DataTable(); dtb = currencyListDAL.GetCurrencyListBySearchParameters(currencyListUI); return(dtb); }
public DataTable GetCurrencyListById(CurrencyListUI currencyListUI) { DataTable dtb = new DataTable(); dtb = currencyListDAL.GetCurrencyListById(currencyListUI); return(dtb); }
public DataTable GetCurrencyListBySearchParameters(CurrencyListUI currencyListUI) { DataSet ds = new DataSet(); DataTable dtbl = new DataTable(); //Boolean result = false; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SqlCommand sqlCmd = new SqlCommand("SP_Currency_SelectBySearchParameters", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@Search", SqlDbType.NVarChar); sqlCmd.Parameters["@Search"].Value = currencyListUI.Search; using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd)) { adapter.Fill(ds); } } if (ds.Tables.Count > 0) { dtbl = ds.Tables[0]; } } catch (Exception exp) { logExcpUIobj.MethodName = "GetCurrencyListBySearchParameters()"; logExcpUIobj.ResourceName = "CurrencyListDAL.CS"; logExcpUIobj.RecordId = "Search = " + currencyListUI.Search; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[CurrencyListDAL : GetCurrencyListBySearchParameters] An error occured in the processing of Record Search = " + currencyListUI.Search + " . Details : [" + exp.ToString() + "]"); } finally { ds.Dispose(); } return(dtbl); }
public int DeleteCurrency(CurrencyListUI currencyListUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_Currency_Delete", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_CurrencyId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_CurrencyId"].Value = currencyListUI.Tbl_CurrencyId; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "DeleteCurrency()"; logExcpUIobj.ResourceName = "CurrencyListDAL.CS"; logExcpUIobj.RecordId = currencyListUI.Tbl_CurrencyId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[CurrencyListDAL : DeleteCurrency] An error occured in the processing of Record Id : " + currencyListUI.Tbl_CurrencyId + ". Details : [" + exp.ToString() + "]"); } return(result); }