private void SearchAssetPurchasetList() { try { AssetPurchaseListUI assetPurchasetListUI = new AssetPurchaseListUI(); assetPurchasetListUI.Search = txtAssetSearch.Text; DataTable dtb = assetPurchaseListBAL.GetAssetPurchaseListSearchParameters(assetPurchasetListUI); if (dtb.Rows.Count > 0 && dtb != null) { gvAssetPurchaseSearch.DataSource = dtb; gvAssetPurchaseSearch.DataBind(); divAssetPurchaseSearchError.Visible = false; } else { divAssetPurchaseSearchError.Visible = true; lblAssetPurchaseSearchError.Text = Resources.GlobalResource.msgNoRecordFound; gvAssetPurchaseSearch.Visible = false; } } catch (Exception exp) { logExcpUIobj.MethodName = "SearchAssetPurchaseList()"; 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 : SearchAssetList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } }
private void BindListBySearchParameters(AssetPurchaseListUI assetPurchaseListUI) { try { DataTable dtb = assetPurchaseListBAL.GetAssetPurchaseListSearchParameters(assetPurchaseListUI); 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 = "Assets_AssetPurchase_AssetPurchaseList.CS"; logExcpUIobj.RecordId = "All"; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[Assets_AssetPurchase_AssetPurchaseList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } }
public DataTable GetAssetPurchaseListSearchParameters(AssetPurchaseListUI assetPurchaseListUI) { DataTable dtb = new DataTable(); dtb = assetPurchaseListDAL.GetAssetPurchaseListSearchParameters(assetPurchaseListUI); return(dtb); }
public int DeleteAssetPurchase(AssetPurchaseListUI assetPurchaseListUI) { int result = 0; result = assetPurchaseListDAL.DeleteAssetPurchase(assetPurchaseListUI); return(result); }
public DataTable GetAssetPurchaseListById(AssetPurchaseListUI assetPurchaseListUI) { DataTable dtb = new DataTable(); dtb = assetPurchaseListDAL.GetAssetPurchaseListById(assetPurchaseListUI); return(dtb); }
public DataTable GetAssetPurchaseListById(AssetPurchaseListUI assetPurchaseListUI) { DataSet ds = new DataSet(); DataTable dtbl = new DataTable(); //Boolean result = false; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SqlCommand sqlCmd = new SqlCommand("SP_AssetPurchase_SelectById", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_AssetPurchaseId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_AssetPurchaseId"].Value = assetPurchaseListUI.Tbl_AssetPurchaseId; using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd)) { adapter.Fill(ds); } } if (ds.Tables.Count > 0) { dtbl = ds.Tables[0]; } } catch (Exception exp) { logExcpUIobj.MethodName = "getAssetPurchaseListById()"; logExcpUIobj.ResourceName = "AssetPurchaseListDAL.CS"; logExcpUIobj.RecordId = assetPurchaseListUI.Tbl_AssetPurchaseId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[AssetPurchaseListDAL : getAssetPurchaseListById] An error occured in the processing of Record Id : " + assetPurchaseListUI.Tbl_AssetPurchaseId + ". Details : [" + exp.ToString() + "]"); } finally { ds.Dispose(); } return(dtbl); }
public int DeleteAssetPurchase(AssetPurchaseListUI assetPurchaseListUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_AssetPurchase_Delete", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_AssetPurchaseId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_AssetPurchaseId"].Value = assetPurchaseListUI.Tbl_AssetPurchaseId; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "DeleteAssetPurchase()"; logExcpUIobj.ResourceName = "AssetPurchaseListDAL.CS"; logExcpUIobj.RecordId = assetPurchaseListUI.Tbl_AssetPurchaseId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[AssetPurchaseListDAL : DeleteAssetPurchase] An error occured in the processing of Record Id : " + assetPurchaseListUI.Tbl_AssetPurchaseId + ". Details : [" + exp.ToString() + "]"); } return(result); }