Exemplo n.º 1
0
        public ToolRDG(string Type, Transaction trans)
        {
            this._type = Type;

            this.trans = trans;
            cmd = new SqlCommand();
        }
Exemplo n.º 2
0
 public TaskRDG(int TaskID, WorkerRDG Worker, Transaction trans)
 {
     this._taskID = TaskID;
     this._worker = Worker;
     this.trans = trans;
     cmd = new SqlCommand();
 }
Exemplo n.º 3
0
 public TaskRDG(int ID, string Feedback, Transaction trans)
 {
     _taskID = ID;
     _feedback = Feedback;
     this.trans = trans;
     cmd = new SqlCommand();
 }
Exemplo n.º 4
0
 public ToolRDG(int ToolId, int ActualMileage, Transaction trans)
 {
     this._toolID = ToolId;
     this._actualMileage = ActualMileage;
     this.trans = trans;
     cmd = new SqlCommand();
 }
Exemplo n.º 5
0
 public ToolRDG(int ToolID, Transaction trans, int ActualHours)
 {
     this._toolID = ToolID;
     this._actualHours = ActualHours;
     this.trans = trans;
     cmd = new SqlCommand();
 }
Exemplo n.º 6
0
        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();
        }
Exemplo n.º 7
0
        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();
        }
Exemplo n.º 8
0
 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;
 }
Exemplo n.º 9
0
        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();
        }
Exemplo n.º 10
0
 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;
 }
Exemplo n.º 11
0
 public TaskRDG(ToolRDG Tool, Transaction trans)
 {
     this._tool = Tool;
     this.trans = trans;
     cmd = new SqlCommand();
 }
Exemplo n.º 12
0
 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;
 }
Exemplo n.º 13
0
 public ToolRDG(Transaction trans)
 {
     this.trans = trans;
     cmd = new SqlCommand();
 }
Exemplo n.º 14
0
        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();
        }
Exemplo n.º 15
0
 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;
 }
Exemplo n.º 16
0
 public NormalUser(string Username, Transaction trans)
     : base(Username, trans)
 {
 }
Exemplo n.º 17
0
 public WorkerRDG(Transaction trans)
 {
     this.trans = trans;
     cmd = new SqlCommand();
 }
Exemplo n.º 18
0
 public ToolRDG(int ToolId, Transaction trans)
 {
     this._toolID = ToolId;
     this.trans = trans;
     cmd = new SqlCommand();
 }
Exemplo n.º 19
0
        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;
        }
Exemplo n.º 20
0
        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;
        }
Exemplo n.º 21
0
 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;
 }
Exemplo n.º 22
0
 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;
 }
Exemplo n.º 23
0
 public Supervisor(Transaction trans)
     : base(trans)
 {
 }
Exemplo n.º 24
0
 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();
 }
Exemplo n.º 25
0
 public WorkerRDG(string Username, Transaction trans)
 {
     this._username = Username;
     this.trans = trans;
     cmd = new SqlCommand();
 }
Exemplo n.º 26
0
        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();
        }
Exemplo n.º 27
0
 public NormalUser(string Username, string Password, string PhoneNr, string Name, string Address, Transaction trans)
     : base(Username, Password, false, PhoneNr, Name, Address, trans)
 {
 }
Exemplo n.º 28
0
 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();
 }
Exemplo n.º 29
0
 public NormalUser(Transaction trans)
     : base(trans)
 {
 }
Exemplo n.º 30
0
 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();
 }