public void CreateMeeting()
 {
     Console.Clear();
     DailyPlanner.AddMeeting();// HZZZZ
     Console.WriteLine("Встреча была создана, нажмите 0 для выхода в меню");
     new Menu().Start();
 }
        public ActionResult DeleteConfirmed(int id)
        {
            DailyPlanner dailyPlanner = db.DailyPlanners.Find(id);

            db.DailyPlanners.Remove(dailyPlanner);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Description,IsDone")] DailyPlanner dailyPlanner)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dailyPlanner).State = EntityState.Modified;
         db.DailyPlanners.Add(dailyPlanner);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dailyPlanner));
 }
예제 #4
0
 private void ChangeStartDate()
 {
     Console.Clear();
     DailyPlanner.SetStartDate(this.currentMeeting);
     if (DateTime.Compare(this.currentMeeting.StartDate, this.currentMeeting.EndDate) > 0)
     {
         Console.WriteLine("\n Окончание встречи не может быть раньше начала, измените дату окончания встречи. \n Для продолжения нажмите любую клавишу");
         Console.ReadKey();
         ChangeEndDate();
     }
     new MeetingEditMenu(this.currentMeeting).Start();
 }
        // GET: DailyPlanners/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DailyPlanner dailyPlanner = db.DailyPlanners.Find(id);

            if (dailyPlanner == null)
            {
                return(HttpNotFound());
            }
            return(View(dailyPlanner));
        }
        public ActionResult Create([Bind(Include = "Id,Description,IsDone")] DailyPlanner dailyPlanner)
        {
            if (ModelState.IsValid)
            {
                string          currentUserId = User.Identity.GetUserId();
                ApplicationUser currentUser   = db.Users.FirstOrDefault
                                                    (x => x.Id == currentUserId);
                dailyPlanner.User = currentUser;
                db.DailyPlanners.Add(dailyPlanner);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(dailyPlanner));
        }
        public List <Meeting> ChooseDateAndGetMeetings()
        {
            Console.Clear();
            Console.WriteLine("Выберите дату начала встречи");
            DateTime queryDate;

            queryDate = Utils.TransformDate();
            var queryMeetings = DailyPlanner.FindAllMeetings(queryDate);

            if (queryMeetings.Count == 0)
            {
                Console.WriteLine("\n Встречи в выбранный день отуствуют.");
                BackToMenuOrKeepGoing();
                ModificationMeeting();
            }
            return(queryMeetings);
        }
예제 #8
0
        static void Main(string[] args)
        {
            Console.CursorVisible = false;
            //Запись из бд

            Getdb();

            while (true)
            {
                MenuSelection(menuItems);

                switch (select)
                {
                case 0:
                    DailyPlanner.ShowRecodrs();
                    PressEnter();
                    break;

                case 1:
                    DailyPlanner.ExpiredRecords();
                    PressEnter();

                    break;

                case 2:
                    DailyPlanner.SortRecords();
                    PressEnter();
                    break;

                case 3:
                    DailyPlanner.AddRecord();
                    PressEnter();
                    break;

                case 4:
                    DailyPlanner.RemoveRecord();
                    PressEnter();
                    break;

                case 5:
                    Environment.Exit(0);
                    break;
                }
            }
        }
예제 #9
0
 public void ChangeAlarmClock()
 {
     Console.Clear();
     DailyPlanner.SetAlarmClock(this.currentMeeting);
     new MeetingEditMenu(this.currentMeeting).Start();
 }
예제 #10
0
 public void ChangeEndDate()
 {
     Console.Clear();
     DailyPlanner.SetEndDate(this.currentMeeting);
     new MeetingEditMenu(this.currentMeeting).Start();
 }
예제 #11
0
 public bool Update(DailyPlanner entity)
 {
     throw new NotImplementedException();
 }