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 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 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(); }