HBM.GeneralManagement.GuestTypeDAO.IsDuplicateTypeName C# (CSharp) Method

IsDuplicateTypeName() public method

public IsDuplicateTypeName ( GuestType guestType ) : bool
guestType GuestType
return bool
        public bool IsDuplicateTypeName(GuestType guestType)
        {
            bool result = false;

            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand dbCommand = db.GetStoredProcCommand("usp_GuestTypeIsDuplicateTypeName");
            db.AddInParameter(dbCommand, "@CompanyId", DbType.Int32, guestType.CompanyId);
            db.AddInParameter(dbCommand, "@GuestTypeId", DbType.Int32, guestType.GuestTypeId);
            db.AddInParameter(dbCommand, "@GuestTypeName", DbType.String, guestType.GuestTypeName);
            db.AddOutParameter(dbCommand, "@IsExist", DbType.Boolean, 1);

            db.ExecuteNonQuery(dbCommand);

            result = Convert.ToBoolean(db.GetParameterValue(dbCommand, "@IsExist").ToString());

            return result;
        }