public static string getQuerySaveRoom(Room room) { return string.Format("INSERT INTO {0} VALUES('{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')", ID_TABLE_ROOM, room.Id, room.Cell.Id, room.Surface, room.Volumen, room.MaxOcup, room.Description, room.LocalInsertTime.ToString(DATETIMEFORMATINSERT_ROOM), room.InsertUser, room.UpdateLocalDateTime.ToString(DATETIMEFORMATINSERT_ROOM), room.UpdateUser); }
public static string getQueryUpdateRoom(Room room) { return string.Format("UPDATE {0} SET {1}='{2}', {3}='{4}',{5}='{6}' ,{7}='{8}' ,{9}='{10}',{11}='{12}',{13}='{14}' WHERE {15}='{16}'", ID_TABLE_ROOM, ID_CELL_ROOM,room.Cell.Id, ID_SURFACE_ROOM,room.Surface, ID_VOLUMEN_ROOM,room.Volumen, ID_MAX_OCUP_ROOM,room.MaxOcup, ID_DESCRIPTION_ROOM, room.Description, ID_UPDATETIME_ROOM, room.UpdateLocalDateTime.ToString(DATETIMEFORMAT_ROOM), ID_UPDATEUSER_ROOM, room.UpdateUser, ID_ID_ROOM, room.Id ); }
public static IList<Room> ParseDataSetToRoom(DataTable dataTable) { IList<Room> roomList = new List<Room>(); foreach (DataRow row in dataTable.Rows) { Room room = new Room() { Id = row[POSITION_ID_ROOM].ToString(), Cell=new Cell(row[POSITION_CELL_ROOM].ToString()), Surface=Double.Parse(row[POSITION_SURFACE_ROOM].ToString()), Volumen = Double.Parse(row[POSITION_VOLUMEN_ROOM].ToString()), MaxOcup = int.Parse(row[POSITION_MAX_OCUP_ROOM].ToString()), Description = row[POSITION_DESCRIPTION_ROOM].ToString(), LocalInsertTime = getDateTime(row[POSITION_INSERTTIME_ROOM].ToString(), DATETIMEFORMATINSERT_ROOM), InsertUser = row[POSITION_INSERTUSER_ROOM].ToString(), UpdateLocalDateTime = getDateTime(row[POSITION_UPDATETIME_ROOM].ToString(),DATETIMEFORMATINSERT_ROOM), UpdateUser = row[POSITION_UPDATEUSER_ROOM].ToString() }; roomList.Add(room); } return roomList; }
public void Update(Room room) { _repositoryHelper.UpdateRoom(room); }
public void Save(Room room) { _repositoryHelper.SaveRoom(room); }
public bool Exists(Room room) { return Get(room.Id) != null; }
internal void UpdateRoom(Room room) { string query = RoomQuery.getQueryUpdateRoom(room); RoomQuery.ParseDataSetToRoom(_provider.queryExecute(query,UPDATE_TYPE)); }
internal void SaveRoom(Room room) { string query = RoomQuery.getQuerySaveRoom(room); RoomQuery.ParseDataSetToRoom(_provider.queryExecute(query,INSERT_TYPE)); }