private void BindListBySearchParameters(PettyCashListUI pettyCashListUI) { try { DataTable dtb = pettyCashListBAL.GetPettyCashListBySearchParameters(this.pettyCashListUI); 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 = "Finance_Bank_Accounting_Petty_Cash_PettyCashList.CS"; logExcpUIobj.RecordId = "All"; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[Finance_Bank_Accounting_Petty_Cash_PettyCashList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } }
public int DeletePettyCash(PettyCashListUI pettyCashListUI) { int result = 0; result = pettyCashListDAL.DeletePettyCash(pettyCashListUI); return(result); }
public DataTable GetPettyCashListBySearchParameters(PettyCashListUI pettyCashListUI) { DataTable dtb = new DataTable(); dtb = pettyCashListDAL.GetPettyCashListBySearchParameters(pettyCashListUI); return(dtb); }
public DataTable GetPettyCashListById(PettyCashListUI pettyCashListUI) { DataTable dtb = new DataTable(); dtb = pettyCashListDAL.GetPettyCashListById(pettyCashListUI); return(dtb); }
public DataTable GetPettyCashListById(PettyCashListUI pettyCashListUI) { DataSet ds = new DataSet(); DataTable dtbl = new DataTable(); //Boolean result = false; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SqlCommand sqlCmd = new SqlCommand("SP_PettyCash_SelectById", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_PettyCashId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_PettyCashId"].Value = pettyCashListUI.Tbl_PettyCashId; using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd)) { adapter.Fill(ds); } } if (ds.Tables.Count > 0) { dtbl = ds.Tables[0]; } } catch (Exception exp) { logExcpUIobj.MethodName = "getPettyCashListById()"; logExcpUIobj.MethodName = "getPettyCashListById()"; logExcpUIobj.MethodName = "getPettyCashListById()"; logExcpUIobj.ResourceName = "PettyCashListDAL.CS"; logExcpUIobj.RecordId = pettyCashListUI.Tbl_PettyCashId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[PettyCashListDAL : getPettyCashListById] An error occured in the processing of Record Id : " + pettyCashListUI.Tbl_PettyCashId + ". Details : [" + exp.ToString() + "]"); } finally { ds.Dispose(); } return(dtbl); }
public int DeletePettyCash(PettyCashListUI pettyCashListUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_PettyCash_Delete", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_PettyCashId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_PettyCashId"].Value = pettyCashListUI.Tbl_PettyCashId; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "DeletePettyCash()"; logExcpUIobj.ResourceName = "PettyCashListDAL.CS"; logExcpUIobj.RecordId = pettyCashListUI.Tbl_PettyCashId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[PettyCashListDAL : DeletePettyCash] An error occured in the processing of Record Id : " + pettyCashListUI.Tbl_PettyCashId + ". Details : [" + exp.ToString() + "]"); } return(result); }