public InsuranceschemeandcodeCount GetInsuranceNameCount(Int64 Insuranceid, string InsuranceName, string InsuranceCode, string ConnectionString) { InsuranceschemeandcodeCount _InsuranceschemeandcodeCount = new InsuranceschemeandcodeCount(); try { if (Insuranceid == 0) { _InsuranceschemeandcodeCount.pSchemeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstinsuranceconfig where upper(InsuranceSchemeName)='" + ManageQuote(InsuranceName).ToUpper() + "' and statusid=" + Convert.ToInt32(Status.Active) + ";")); _InsuranceschemeandcodeCount.pSchemeCodeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstinsuranceconfig where upper(insuranceschemecode)='" + ManageQuote(InsuranceCode).ToUpper() + "' and statusid=" + Convert.ToInt32(Status.Active) + ";")); } else { _InsuranceschemeandcodeCount.pSchemeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstinsuranceconfig where upper(InsuranceSchemeName)='" + ManageQuote(InsuranceName).ToUpper() + "' and insuranceschemeconfigid <> " + Insuranceid + " and statusid=" + Convert.ToInt32(Status.Active) + ";")); _InsuranceschemeandcodeCount.pSchemeCodeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstinsuranceconfig where upper(insuranceschemecode)='" + ManageQuote(InsuranceCode).ToUpper() + "' and insuranceschemeconfigid <> " + Insuranceid + " and statusid=" + Convert.ToInt32(Status.Active) + ";")); } } catch (Exception) { throw; } return(_InsuranceschemeandcodeCount); }
public IActionResult GetInsuranceNameCount(Int64 Insuranceid, string InsuranceName, string InsuranceCode) { try { InsuranceschemeandcodeCount _InsuranceschemeandcodeCount = objInsurenceconfig.GetInsuranceNameCount(Insuranceid, InsuranceName, InsuranceCode, Con); if (_InsuranceschemeandcodeCount != null) { return(Ok(_InsuranceschemeandcodeCount)); } else { return(StatusCode(StatusCodes.Status204NoContent)); } } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError)); } }