Exemplo n.º 1
0
        // 删除日志
        public void deleteDiary(int id)
        {
            DiaryEntities db        = new DiaryEntities();
            Diary         delRecord = new Diary()
            {
                diary_id = id
            };

            db.Diary.Attach(delRecord);
            db.Diary.Remove(delRecord);
            try
            {
                db.SaveChanges();
            }
            catch (Exception)
            {
                Response.Write("Error");
                Response.End();
                return;
            }

            Response.Write("Success");
            Response.End();
        }
Exemplo n.º 2
0
 public void Report()
 {
     Console.WriteLine("Report generation");
     diary = Diary.Load(filename);
     diary.Report(cli.all);
 }
Exemplo n.º 3
0
 public void Create()
 {
     Console.WriteLine("Create diary");
     diary = Diary.Create(filename, cli.duration);
 }