예제 #1
0
 public void DeleteReport(DateTime _date)
 {
     DAL.Report r = new DAL.Report();
     r = context.Reports.SingleOrDefault(cl => cl.dateOfReport == _date);
     context.Reports.Remove(r);
     context.SaveChanges();
 }
예제 #2
0
 public void AddReport(Report _report)
 {
     DAL.Report report = new DAL.Report
     {
         dateOfReport = _report.DateOfReport,
         report1      = _report.Report1
     };
     context.Reports.Add(report);
     context.SaveChanges();
 }
예제 #3
0
 public Report GetByDate(DateTime _date)
 {
     DAL.Report r = new DAL.Report();
     r = context.Reports.SingleOrDefault(cl => cl.dateOfReport == _date);
     if (r != null)
     {
         Model.Report report = new Model.Report
         {
             DateOfReport = r.dateOfReport,
             Report1      = r.report1
         };
         return(report);
     }
     else
     {
         return(null);
     }
 }