public bool Create(DataMembers obj) { StatusReport StatusTable = new StatusReport(); StatusTable.StatusText = obj.Text; StatusTable.StatusTitle = obj.Title; StatusTable.WorkPacRefId = obj.WorkPacId; StatusTable.StatusDate = obj.Date; var _req = from req in ent.WorkPacRefs select req; foreach (WorkPacRef w in _req) { if (obj.WorkPacId == w.WorkPacRefId) { ent.StatusReports.InsertOnSubmit(StatusTable); ent.SubmitChanges(); return true; } else { } } return false; }
private void detach_StatusReports(StatusReport entity) { this.SendPropertyChanging(); entity.WorkPacRef = null; }
partial void DeleteStatusReport(StatusReport instance);
partial void UpdateStatusReport(StatusReport instance);
partial void InsertStatusReport(StatusReport instance);
public DataMembers Edit(int Id) { StatusReport StatusTable = new StatusReport(); DataMembers data = new DataMembers(); var _edit = from req in ent.StatusReports where req.StatusId == Id select req; data.Title = _edit.First().StatusTitle; data.Text = _edit.First().StatusText; data.Date = _edit.First().StatusDate; data.WorkPacId = _edit.First().WorkPacRefId; return data; }