public static int GetEmployeesTotalNumber(DAOAcsessModifier modifier) { try { switch (modifier) { case DAOAcsessModifier.GetEmployeesTotalNumber: return(GetEmployeesTotalNumberInternal()); } throw new Exception($"'DAOAcsessModifier' must be {DAOAcsessModifier.GetEmployeesTotalNumber}"); } catch (Exception ex) { throw new Exception($"{ex.GetType().Name}\n\n{ex.Message}\n\n Path to the DataBase file: \n{_dBpath}\n\n{ex.StackTrace}"); } }
public static T GetData <T>(DAOAcsessModifier modifier) where T : class { try { //T returnValue; switch (modifier) { case DAOAcsessModifier.GetAllEmployees: return(GetEmployeesInternal() as T); } throw new Exception($"'DAOAcsessModifier' must be {DAOAcsessModifier.GetEmployeesTotalNumber}"); } catch (Exception ex) { throw new Exception($"{ex.GetType().Name}\n\n{ex.Message}\n\n Path to the DataBase file: \n{_dBpath}\n\n{ex.StackTrace}"); } }
public static void SetData <T>(T t, DAOAcsessModifier modifier) { try { switch (modifier) { case DAOAcsessModifier.InsertEmployee: AddEmployeeInternal <T>(t); break; case DAOAcsessModifier.DeleteEmployee: DeleteEmployeeInternal <T>(t); break; case DAOAcsessModifier.UpdateEmployee: UpdateEmployeeInternal <T>(t); break; } } catch (Exception ex) { throw new Exception($"{ex.GetType().Name}\n\n{ex.Message}\n\n Path to the DataBase file: \n{_dBpath}\n\n{ex.StackTrace}"); } }