public void AddResponse(ResponseWrapper response) { ResponseTableAdapter ad=new ResponseTableAdapter(); System.Diagnostics.Debug.WriteLine(response.ToString()); System.Diagnostics.Debug.WriteLine(response.User.UserID); ad.Insert(response.User.UserID, response.Unit.UnitCode, response.Comment, response.Rating); }
public IEnumerable<ResponseWrapper> GetResponses(string unitCode) { ResponseTableAdapter ad = new ResponseTableAdapter(); DBDataSet.ResponseDataTable tbl = ad.GetData(unitCode); UserAccess ua = new UserAccess(); return tbl.Select(r => new ResponseWrapper() { UnitCode = r.UnitCode, Comment = r.Comment, Rating = r.Rating, ResponseId = r.ResponseId, Time = r.Time, User = ua.GetUserWithID(r.UserID), }); }
public void UpdateResponse(ResponseWrapper response) { ResponseTableAdapter ad = new ResponseTableAdapter(); ad.Update(response.Comment, response.Rating, response.User.UserID, response.UnitCode, response.Time, response.ResponseId); }