public ToolRDG(string Type, Transaction trans) { this._type = Type; this.trans = trans; cmd = new SqlCommand(); }
public TaskRDG(int TaskID, WorkerRDG Worker, Transaction trans) { this._taskID = TaskID; this._worker = Worker; this.trans = trans; cmd = new SqlCommand(); }
public TaskRDG(int ID, string Feedback, Transaction trans) { _taskID = ID; _feedback = Feedback; this.trans = trans; cmd = new SqlCommand(); }
public ToolRDG(int ToolId, int ActualMileage, Transaction trans) { this._toolID = ToolId; this._actualMileage = ActualMileage; this.trans = trans; cmd = new SqlCommand(); }
public ToolRDG(int ToolID, Transaction trans, int ActualHours) { this._toolID = ToolID; this._actualHours = ActualHours; this.trans = trans; cmd = new SqlCommand(); }
public TaskRDG(ToolRDG tool, NormalUser worker, string Description, DateTime Date, Transaction trans) { this._tool = tool; this._description = Description; this._date = Date; this._user = worker; this.trans = trans; cmd = new SqlCommand(); }
public WorkerRDG(string Username, string Password, bool IsSuperviser, string PhoneNr, string Name, string Address, Transaction trans) { this._username = Username; this._password = Password; this._isSuperviser = IsSuperviser; this._phoneNr = PhoneNr; this._name = Name; this._address = Address; this.trans = trans; cmd = new SqlCommand(); }
public bool createToolWithMileage(string type, DateTime servicedate, int servicemileage, int actualmileage, int milesperday) { Transaction trans = new Transaction(); ToolRDG TOOLRDG = new ToolRDG(type, trans); trans.BeginTransaction(); try { TOOLRDG.CreateToolMileage(servicedate, servicemileage, actualmileage, milesperday); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); return true; }
public void CreateTask(string Description, string Username, int ToolID, DateTime Date) { Transaction trans = new Transaction(); ToolRDG toolrdg = new ToolRDG(ToolID); NormalUser woerkerdg = new NormalUser(Username); TaskRDG TRDG = new TaskRDG(toolrdg,woerkerdg,Description, Date, trans); trans.BeginTransaction(); try { TRDG.CreateTaskDB(); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); }
public List<TaskDTO> GetNotifications(DateTime date, string Username = "") { Transaction trans = new Transaction(); List<TaskDTO> tasklist; TaskRDG task = new TaskRDG(trans); trans.BeginTransaction(); try { tasklist = task.GetNotified(date, Username); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); return tasklist; }
public TaskRDG(ToolRDG Tool, Transaction trans) { this._tool = Tool; this.trans = trans; cmd = new SqlCommand(); }
public List<TaskDTO> GetAllTaskForATool(int ToolId) { Transaction trans = new Transaction(); ToolRDG tool = new ToolRDG(ToolId); TaskRDG task = new TaskRDG(tool, trans); List<TaskDTO> tasks = new List<TaskDTO>(); trans.BeginTransaction(); try { tasks = task.GetAllTasksFromTool(task); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); return tasks; }
public ToolRDG(Transaction trans) { this.trans = trans; cmd = new SqlCommand(); }
public void DeleteTool(int toolID) { Transaction trans = new Transaction(); ToolRDG TOOLRDG = new ToolRDG(toolID, trans); trans.BeginTransaction(); try { TOOLRDG.DeleteTool(); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); }
public List<TaskDTO> GetAllTasks() { Transaction trans = new Transaction(); TaskRDG TRDG = new TaskRDG(trans); List<TaskDTO> ListOfAllTasks = new List<TaskDTO>(); trans.BeginTransaction(); try { ListOfAllTasks = TRDG.GetAllTasks(); } catch (Exception e) { trans.Rollback(); throw e; } return ListOfAllTasks; }
public NormalUser(string Username, Transaction trans) : base(Username, trans) { }
public WorkerRDG(Transaction trans) { this.trans = trans; cmd = new SqlCommand(); }
public ToolRDG(int ToolId, Transaction trans) { this._toolID = ToolId; this.trans = trans; cmd = new SqlCommand(); }
public List<WorkerDTO> GetAllWorkers() { Transaction trans = new Transaction(); List<WorkerDTO> LowDTO; WorkerRDG wRDG = new WorkerRDG(trans); trans.BeginTransaction(); try { LowDTO = wRDG.GetAllWorkers(); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); return LowDTO; }
public List<int> GetAllToolsID() { Transaction trans = new Transaction(); ToolRDG TOOLRDG = new ToolRDG(trans); List<int> ToolIDList = new List<int>(); trans.BeginTransaction(); try { ToolIDList = TOOLRDG.GetAllToolsID(); } catch (Exception e) { throw e; } return ToolIDList; }
public List<ToolDTO> GetAllTools() { Transaction trans = new Transaction(); List<ToolDTO> tools; ToolRDG toolRDG = new ToolRDG(trans); trans.BeginTransaction(); try { tools = toolRDG.GetAllTools(); } catch(Exception e) { trans.Rollback(); throw e; } trans.Commit(); return tools; }
public List<TaskDTO> GetAllTasksFromWorker(string Username) { Transaction trans = new Transaction(); WorkerRDG WRDG = new WorkerRDG(Username); TaskRDG TRDG = new TaskRDG(WRDG, trans); List<TaskDTO> ListOfTasks = new List<TaskDTO>(); trans.BeginTransaction(); try { ListOfTasks = TRDG.GetAllTasksFromWorker(TRDG); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); return ListOfTasks; }
public Supervisor(Transaction trans) : base(trans) { }
public void ReassignTask(int TaskID, string WorkerUsername) { Transaction trans = new Transaction(); WorkerRDG worker = new WorkerRDG(WorkerUsername); TaskRDG task = new TaskRDG(TaskID, worker, trans); trans.BeginTransaction(); try { task.ReassignTask(); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); }
public WorkerRDG(string Username, Transaction trans) { this._username = Username; this.trans = trans; cmd = new SqlCommand(); }
public void RegisterWorker(string Username, string Password, string Name, string Address, string PhoneNr) { Transaction trans = new Transaction(); NormalUser NRDG = new NormalUser(Username, Password, PhoneNr, Name, Address, trans); trans.BeginTransaction(); try { NRDG.RegisterNormalUserDB(); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); }
public NormalUser(string Username, string Password, string PhoneNr, string Name, string Address, Transaction trans) : base(Username, Password, false, PhoneNr, Name, Address, trans) { }
public void UpdateActualMileage(int ToolID, int ActualMileage) { Transaction trans = new Transaction(); ToolRDG tool = new ToolRDG(ToolID, ActualMileage, trans); trans.BeginTransaction(); try { tool.UpdateActualMileage(); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); }
public NormalUser(Transaction trans) : base(trans) { }
public void UpdateTaskStatus(int ID, string Feedback) { Transaction trans = new Transaction(); TaskRDG TRDG = new TaskRDG(ID, Feedback, trans); trans.BeginTransaction(); try { TRDG.UpdateTaskStatus(); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); }