public BookingSavedStatus SaveNewParkingData(VehichleData vehichleData) { VehichleDataDb data = _dataMapperToDb.Translate(vehichleData); data.ParkingLotId = GetParkingLotId(); return(_crudOperator.Save(data)); }
public BookingSavedStatus Save(VehichleDataDb data) { DateTime dateTime = System.DateTime.Now; string query = String.Format(INSERT_FULL_FORM_DATA, data.VehichleNumber, data.VehichleWeight, data.VehichleType, data.ParkingLotId, data.CustomerFullName, data.ContactNumber, dateTime.ToString("yyyy-MM-dd HH:MM")); BookingSavedStatus bookingSavedStatus = new BookingSavedStatus(); try { ExecuteQuerry(query); bookingSavedStatus.IsSaved = true; } catch (Exception ex) { _logger.WriteLogs(string.Format(_logPath + "{0}\\PerchedPeackockLogs.txt", Environment.UserName), ex.Message); bookingSavedStatus.IsSaved = false; return(bookingSavedStatus); } ParkingReceipt parkingReceipt = PrepareParkingReceipt(new string[] { data.VehichleNumber, data.entryDateTime }); bookingSavedStatus.ParkingReceipt = parkingReceipt; return(bookingSavedStatus); }