public ActionResult CreateRecord(int databaseId, DatabaseUpdateRecordInfo record) { if (string.IsNullOrEmpty(record.Proposer)) { ViewBag.Message = "修改记录必须指定申请人!"; return View(record); } if (string.IsNullOrEmpty(record.TableName)) { ViewBag.Message = "修改记录必须指定修改的表名称!"; return View(record); } if (string.IsNullOrEmpty(record.Introduction)) { ViewBag.Message = "修改记录必须备注必要的描述信息!"; return View(record); } record.DatabaseId = databaseId; record.CreationTime = DateTime.Now; _databaseRepository.CreateRecord(record); return RedirectToAction("RecordList", new { databaseId = databaseId }); }
public void DeleteRecord(DatabaseUpdateRecordInfo record) { DataContext.Entry(record).State = System.Data.EntityState.Deleted; DataContext.SaveChanges(); }
public void CreateRecord(DatabaseUpdateRecordInfo record) { DataContext.DatabaseUpdateRecordInfoes.Add(record); DataContext.SaveChanges(); }