private void BindListBySearchParameters(OrganizationTypeListUI organizationTypeListUI) { try { DataTable dtb = organizationTypeListBAL.GetOrganizationTypeListBySearchParameters(this.organizationTypeListUI); 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_OrganizationTypeList.CS"; logExcpUIobj.RecordId = "All"; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[System_Settings_OrganizationTypeList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } }
public int DeleteOrganizationType(OrganizationTypeListUI organizationTypeListUI) { int result = 0; result = organizationTypeListDAL.DeleteOrganizationType(organizationTypeListUI); return(result); }
public DataTable GetOrganizationTypeListBySearchParameters(OrganizationTypeListUI organizationTypeListUI) { DataTable dtb = new DataTable(); dtb = organizationTypeListDAL.GetOrganizationTypeListBySearchParameters(organizationTypeListUI); return(dtb); }
public DataTable GetOrganizationTypeListById(OrganizationTypeListUI organizationTypeListUI) { DataTable dtb = new DataTable(); dtb = organizationTypeListDAL.GetOrganizationTypeListById(organizationTypeListUI); return(dtb); }
public DataTable GetOrganizationTypeListById(OrganizationTypeListUI organizationTypeListUI) { DataSet ds = new DataSet(); DataTable dtbl = new DataTable(); //Boolean result = false; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SqlCommand sqlCmd = new SqlCommand("SP_OrganizationType_SelectById", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_OrganizationTypeId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_OrganizationTypeId"].Value = organizationTypeListUI.Tbl_OrganizationTypeId; using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd)) { adapter.Fill(ds); } } if (ds.Tables.Count > 0) { dtbl = ds.Tables[0]; } } catch (Exception exp) { logExcpUIobj.MethodName = "getOrganizationTypeListById()"; logExcpUIobj.ResourceName = "OrganizationTypeListDAL.CS"; logExcpUIobj.RecordId = organizationTypeListUI.Tbl_OrganizationTypeId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[OrganizationTypeListDAL : getOrganizationTypeListById] An error occured in the processing of Record Id : " + organizationTypeListUI.Tbl_OrganizationTypeId + ". Details : [" + exp.ToString() + "]"); } finally { ds.Dispose(); } return(dtbl); }
public int DeleteOrganizationType(OrganizationTypeListUI organizationTypeListUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_OrganizationType_Delete", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_OrganizationTypeId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_OrganizationTypeId"].Value = organizationTypeListUI.Tbl_OrganizationTypeId; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "DeleteOrganizationType()"; logExcpUIobj.ResourceName = "OrganizationTypeListDAL.CS"; logExcpUIobj.RecordId = organizationTypeListUI.Tbl_OrganizationTypeId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[OrganizationTypeListDAL : DeleteOrganizationType] An error occured in the processing of Record Id : " + organizationTypeListUI.Tbl_OrganizationTypeId + ". Details : [" + exp.ToString() + "]"); } return(result); }