Esempio n. 1
0
        public DataSet SelectAll(Source source)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand dbCommand = db.GetStoredProcCommand("usp_SourceSelectAll");
            db.AddInParameter(dbCommand, "@CompanyId", DbType.Int32, source.CompanyId);

            return db.ExecuteDataSet(dbCommand);
        }
Esempio n. 2
0
        public bool IsDuplicateTypeName(Source source)
        {
            bool result = false;

            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand dbCommand = db.GetStoredProcCommand("usp_SourceIsDuplicateTypeName");
            db.AddInParameter(dbCommand, "@CompanyId", DbType.Int32, source.CompanyId);
            db.AddInParameter(dbCommand, "@SourceId", DbType.Int32, source.SourceId);
            db.AddInParameter(dbCommand, "@SourceName", DbType.String, source.SourceName);
            db.AddOutParameter(dbCommand, "@IsExist", DbType.Boolean, 1);

            db.ExecuteNonQuery(dbCommand);

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

            return result;
        }