Ejemplo n.º 1
0
        public DataSet SelectAll(BedType bedType)
        {
            Database  db        = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand dbCommand = db.GetStoredProcCommand("usp_BedTypeSelectAll");

            db.AddInParameter(dbCommand, "@CompanyId", DbType.Int32, bedType.CompanyId);

            return(db.ExecuteDataSet(dbCommand));
        }
Ejemplo n.º 2
0
        public bool Delete(BedType bedType)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand command = db.GetStoredProcCommand("usp_BedTypeDelete");

            db.AddInParameter(command, "@BedTypeId", DbType.Int32, bedType.BedTypeId);

            db.ExecuteNonQuery(command);

            return true;
        }
Ejemplo n.º 3
0
        public bool Delete(BedType bedType)
        {
            Database  db      = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand command = db.GetStoredProcCommand("usp_BedTypeDelete");

            db.AddInParameter(command, "@BedTypeId", DbType.Int32, bedType.BedTypeId);

            db.ExecuteNonQuery(command);

            return(true);
        }
Ejemplo n.º 4
0
        public bool IsDuplicateTypeName(BedType bedType)
        {
            bool result = false;

            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand dbCommand = db.GetStoredProcCommand("usp_BedTypeIsDuplicateTypeName");
            db.AddInParameter(dbCommand, "@CompanyId", DbType.Int32, bedType.CompanyId);
            db.AddInParameter(dbCommand, "@BedTypeId", DbType.Int32, bedType.BedTypeId);
            db.AddInParameter(dbCommand, "@BedTypeName", DbType.String, bedType.BedTypeName);
            db.AddOutParameter(dbCommand, "@IsExist", DbType.Boolean, 1);

            db.ExecuteNonQuery(dbCommand);

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

            return result;
        }
Ejemplo n.º 5
0
        public bool Insert(BedType bedType)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand command = db.GetStoredProcCommand("usp_BedTypeInsert");

            db.AddInParameter(command, "@CompanyId", DbType.Int32, bedType.CompanyId);
            db.AddInParameter(command, "@BedTypeName", DbType.String, bedType.BedTypeName);
            db.AddInParameter(command, "@BedTypeDescription", DbType.String, bedType.BedTypeDescription);
            db.AddInParameter(command, "@CreatedBy", DbType.Int32, bedType.CreatedBy);
            db.AddInParameter(command, "@CreatedDate", DbType.DateTime, bedType.CreatedDate);
            db.AddInParameter(command, "@UpdatedBy", DbType.Int32, bedType.UpdatedBy);
            db.AddInParameter(command, "@UpdatedDate", DbType.DateTime, bedType.UpdatedDate);
            db.AddInParameter(command, "@StatusId", DbType.Int32, bedType.StatusId);

            db.ExecuteNonQuery(command);

            return true;
        }
Ejemplo n.º 6
0
        public bool Insert(BedType bedType)
        {
            Database  db      = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand command = db.GetStoredProcCommand("usp_BedTypeInsert");

            db.AddInParameter(command, "@CompanyId", DbType.Int32, bedType.CompanyId);
            db.AddInParameter(command, "@BedTypeName", DbType.String, bedType.BedTypeName);
            db.AddInParameter(command, "@BedTypeDescription", DbType.String, bedType.BedTypeDescription);
            db.AddInParameter(command, "@CreatedBy", DbType.Int32, bedType.CreatedBy);
            db.AddInParameter(command, "@CreatedDate", DbType.DateTime, bedType.CreatedDate);
            db.AddInParameter(command, "@UpdatedBy", DbType.Int32, bedType.UpdatedBy);
            db.AddInParameter(command, "@UpdatedDate", DbType.DateTime, bedType.UpdatedDate);
            db.AddInParameter(command, "@StatusId", DbType.Int32, bedType.StatusId);

            db.ExecuteNonQuery(command);

            return(true);
        }
Ejemplo n.º 7
0
        public bool IsDuplicateTypeName(BedType bedType)
        {
            bool result = false;

            Database  db        = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand dbCommand = db.GetStoredProcCommand("usp_BedTypeIsDuplicateTypeName");

            db.AddInParameter(dbCommand, "@CompanyId", DbType.Int32, bedType.CompanyId);
            db.AddInParameter(dbCommand, "@BedTypeId", DbType.Int32, bedType.BedTypeId);
            db.AddInParameter(dbCommand, "@BedTypeName", DbType.String, bedType.BedTypeName);
            db.AddOutParameter(dbCommand, "@IsExist", DbType.Boolean, 1);

            db.ExecuteNonQuery(dbCommand);

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


            return(result);
        }
Ejemplo n.º 8
0
        public DataSet SelectAll(BedType bedType)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand dbCommand = db.GetStoredProcCommand("usp_BedTypeSelectAll");
            db.AddInParameter(dbCommand, "@CompanyId", DbType.Int32, bedType.CompanyId);

            return db.ExecuteDataSet(dbCommand);
        }