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)); }
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; }
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); }
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; }
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; }
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); }
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); }
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); }