Exemplo n.º 1
0
        public MemberschemeandcodeCount GetMemberNameCount(Int64 memberid, string MemberType, string MemberTypeCode, string ConnectionString)
        {
            MemberschemeandcodeCount _memberschemeandcodeCount = new MemberschemeandcodeCount();

            try
            {
                if (memberid == 0)
                {
                    _memberschemeandcodeCount.pSchemeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstmembertypes where upper(membertype)='" + ManageQuote(MemberType).ToUpper() + "' and statusid=" + Convert.ToInt32(Status.Active) + ";"));

                    _memberschemeandcodeCount.pSchemeCodeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstmembertypes where upper(membertypecode)='" + ManageQuote(MemberTypeCode).ToUpper() + "' and statusid=" + Convert.ToInt32(Status.Active) + ";"));
                }
                else
                {
                    _memberschemeandcodeCount.pSchemeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstmembertypes where upper(membertype)='" + ManageQuote(MemberType).ToUpper() + "' and membertypeid <> " + memberid + " and statusid=" + Convert.ToInt32(Status.Active) + ";"));

                    _memberschemeandcodeCount.pSchemeCodeCount = Convert.ToInt32(NPGSqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, "select count(*) from tblmstmembertypes where upper(membertypecode)='" + ManageQuote(MemberTypeCode).ToUpper() + "' and membertypeid <> " + memberid + " and statusid=" + Convert.ToInt32(Status.Active) + ";"));
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(_memberschemeandcodeCount);
        }
 public IActionResult GetMemberNameCount(Int64 memberid, string MemberType, string MemberTypeCode)
 {
     try
     {
         MemberschemeandcodeCount _MemberschemeandcodeCount = objmemtype.GetMemberNameCount(memberid, MemberType, MemberTypeCode, Con);
         if (_MemberschemeandcodeCount != null)
         {
             return(Ok(_MemberschemeandcodeCount));
         }
         else
         {
             return(StatusCode(StatusCodes.Status204NoContent));
         }
     }
     catch (Exception)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError));
     }
 }