public static Error GuardarErrorEnDB(Exception ex, string username) { try { LOG_ERROR_SITIO logErrorDA = new LOG_ERROR_SITIO(); logErrorDA.FECHA = DateTime.Now; if (ex.InnerException != null) { logErrorDA.XML_ERR = FormatearMensajeError(ex.Message, ex.StackTrace, username, ex.InnerException.Message, ex.InnerException.StackTrace); } else { logErrorDA.XML_ERR = FormatearMensajeError(ex.Message, ex.StackTrace, username); } if (logErrorDA.XML_ERR.Length > 3998) { logErrorDA.XML_ERR = logErrorDA.XML_ERR.Substring(0, 3998); } var pIdError = ErrorDAO.guardarErrorDB(logErrorDA); return(new Error { idError = pIdError }); } catch { return(new Error { idError = 0 }); } }
public void RemoveEmployee(Employee employee) { try { employeeDao.RemoveEmployee(employee); } catch { string errorstr = "Chapeau App couldn't remove the employee account"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public List <Employee> GetAllEmployees() { try { return(employeeDao.GetAllEmployees()); } catch { string errorstr = "Chapeau App couldn't return the employees"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public void CreateReservation(int tableNumber, string reservationDate, long phoneNumber, string reserverName) { try { reservationDao.CreateReservation(tableNumber, reservationDate, phoneNumber, reserverName); } catch { string errorstr = "Chapeau App couldn't create the reservation"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public List <Reservation> GetAllReservations() { try { return(reservationDao.GetAllReservations()); } catch { string errorstr = "Chapeau App couldn't get the reservations"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public Table GetById(int id) { try { return(tabledao.GetById(id)); } catch { string errorstr = "Chapeau App couldn't get the table"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public void SetNoOccupied(int tableNr) // Required method overload for order part of the application. { try { tabledao.SetNoOccupied(new Table(tableNr)); } catch { string errorstr = "Chapeau App couldn't set the tables"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public void SetNoOccupied(Table table) { try { tabledao.SetNoOccupied(table); } catch { string errorstr = "Chapeau App couldn't set the tables"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public void SetOccupied(int tableNr) { try { tabledao.SetOccupied(new Table(tableNr)); } catch { string errorstr = "Chapeau App couldn't set the tables"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public List <Table> GetAllTables() { try { return(tabledao.GetAllTables()); } catch { string errorstr = "Chapeau App couldn't get the tables"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public Employee GetById(int id) { try { return(employeeDao.GetById(id)); } catch { string errorstr = "Chapeau App couldn't get the employee account"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public Employee GetEmployeeByCredentials(string username, string password) { try { return(employeeDao.GetEmployeeByCredentials(username, password)); } catch { string errorstr = "Chapeau App couldn't return the employee with these credentials"; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public List <MenuItem> GetMenuItems() { //I added try catch to your section I hope you don't mind this change. I appreciate it if you double check. try { return(DAO.GetCompleteMenu()); } catch { string errorstr = "Chapeau App couldn't get the menu items."; ErrorDAO error = new ErrorDAO(errorstr); throw; } }
public List <Supervisor> GetAllSupervisors() { List <Supervisor> supervisorList = new List <Supervisor>(); try { supervisorList = supervisor_dao.Db_Get_AllSupervisors(); return(supervisorList); } catch { string exp = "SomerenApp couldn't get the supervisor list"; ErrorDAO error = new ErrorDAO(exp); return(null); } }
public List <Teacher> GetLecturers() { List <Teacher> teacherlist = new List <Teacher>(); try { teacherlist = lecturer_db.Db_Get_AllTeachers(); return(teacherlist); } catch { string exp = "SomerenApp couldn't get the lecturer list"; ErrorDAO error = new ErrorDAO(exp); return(null); } }
public List <Drink> GetDrinks() { List <Drink> drinkList = new List <Drink>(); try { drinkList = drink_dao.Db_Get_AllDrinks(); return(drinkList); } catch { string exp = "SomerenApp couldn't get the drink list"; ErrorDAO error = new ErrorDAO(exp); return(null); } }
public List <Room> GetRooms() { List <Room> Rooms = new List <Room>(); try { Rooms = roomservice.Db_Get_All_Rooms(); return(Rooms); } catch { string exp = "SomerenApp couldn't open the room list"; ErrorDAO error = new ErrorDAO(exp); return(null); } }
public List <Student> GetStudents() { List <Student> student = new List <Student>(); try { student = student_db.Db_Get_All_Students(); return(student); } catch { string exp = "SomerenApp couldn't get the student list"; ErrorDAO error = new ErrorDAO(exp); return(null); } }
public Error_Service(string errorMsg) { ErrorDAO error = new ErrorDAO(errorMsg); }