Пример #1
0
        public SavingschemeandcodeCount GetSavingAccNameCodeCount(Int64 SavingAccid, string SavingAccName, string SavingAccCode, string ConnectionString)
        {
            SavingschemeandcodeCount _SavingschemeandcodeCount = new SavingschemeandcodeCount();

            try
            {
                if (SavingAccid == 0)
                {
                    _SavingschemeandcodeCount.pSchemeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstSavingAccountConfig where upper(savingaccname)='" + ManageQuote(SavingAccName).ToUpper() + "' and statusid=" + Convert.ToInt32(Status.Active) + ";"));

                    _SavingschemeandcodeCount.pSchemeCodeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstSavingAccountConfig where upper(savingacccode)='" + ManageQuote(SavingAccCode).ToUpper() + "' and statusid=" + Convert.ToInt32(Status.Active) + ";"));
                }
                else
                {
                    _SavingschemeandcodeCount.pSchemeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstSavingAccountConfig where upper(savingaccname)='" + ManageQuote(SavingAccName).ToUpper() + "' and savingconfigid <> " + SavingAccid + " and statusid=" + Convert.ToInt32(Status.Active) + ";"));

                    _SavingschemeandcodeCount.pSchemeCodeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstSavingAccountConfig where upper(savingacccode)='" + ManageQuote(SavingAccCode).ToUpper() + "' and savingconfigid <> " + SavingAccid + " and statusid=" + Convert.ToInt32(Status.Active) + ";"));
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(_SavingschemeandcodeCount);
        }
 public IActionResult GetSavingAccNameCodeCount(Int64 SavingAccid, string SavingAccName, string SavingAccCode)
 {
     try
     {
         SavingschemeandcodeCount _SavingschemeandcodeCount = objSavingAccountConfig.GetSavingAccNameCodeCount(SavingAccid, SavingAccName, SavingAccCode, Con);
         if (_SavingschemeandcodeCount != null)
         {
             return(Ok(_SavingschemeandcodeCount));
         }
         else
         {
             return(StatusCode(StatusCodes.Status204NoContent));
         }
     }
     catch (Exception)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError));
     }
 }