public ShareschemeandcodeCount GetShareNameCodeCount(Int64 shareid, string ShareName, string ShareCode, string ConnectionString)
        {
            ShareschemeandcodeCount _ShareschemeandcodeCount = new ShareschemeandcodeCount();

            try
            {
                if (shareid == 0)
                {
                    _ShareschemeandcodeCount.pSchemeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstshareconfig where upper(sharename)='" + ManageQuote(ShareName).ToUpper() + "' and statusid=" + Convert.ToInt32(Status.Active) + ";"));

                    _ShareschemeandcodeCount.pSchemeCodeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstshareconfig where upper(sharecode)='" + ManageQuote(ShareCode).ToUpper() + "' and statusid=" + Convert.ToInt32(Status.Active) + ";"));
                }
                else
                {
                    _ShareschemeandcodeCount.pSchemeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstshareconfig where upper(sharename)='" + ManageQuote(ShareName).ToUpper() + "' and shareconfigid <> " + shareid + " and statusid=" + Convert.ToInt32(Status.Active) + ";"));

                    _ShareschemeandcodeCount.pSchemeCodeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstshareconfig where upper(sharecode)='" + ManageQuote(ShareCode).ToUpper() + "' and shareconfigid <> " + shareid + " and statusid=" + Convert.ToInt32(Status.Active) + ";"));
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(_ShareschemeandcodeCount);
        }
 public IActionResult GetShareNameCodeCount(Int64 shareid, string ShareName, string ShareCode)
 {
     try
     {
         ShareschemeandcodeCount _ShareschemeandcodeCount = ObjShareConfig.GetShareNameCodeCount(shareid, ShareName, ShareCode, Con);
         if (_ShareschemeandcodeCount != null)
         {
             return(Ok(_ShareschemeandcodeCount));
         }
         else
         {
             return(StatusCode(StatusCodes.Status204NoContent));
         }
     }
     catch (Exception)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError));
     }
 }