예제 #1
0
        public ActionResult Create(int goalID = 0, int parentTaskID = 0, string ActionItemCode = "", string Code = "Goal")
        {
            if (Code == "Goal")
            {
                goal goal = GoalRepository.GetGoalByID(goalID);
                ViewBag.Heading    = string.Format("Add Tasks to Goal ({0})", goal.Title);
                ViewBag.SubHeading = "Add New Task..";
                GetData(goal.ministryID);
            }
            else if (Code == "ActionItem")
            {
                task task = TaskRepository.GetTaskByID(parentTaskID);
                goal gol  = GoalRepository.GetGoalByID(goalID);
                ViewBag.Heading    = string.Format("Add Action Item to Task ({0} - {1})", gol.Title, task.Title);
                ViewBag.SubHeading = "Add New Action Item..";
                GetData(gol.ministryID);
            }
            else
            {
                meetingagenda agenda = MeetingAgendaRepository.GetAgendaByID(goalID);
                ViewBag.GoalTitle = agenda.Description;
                int ministryID = MeetingRepository.GetMeetingByID(agenda.meetingID).ministryID;
                GetData(ministryID);
            }

            ViewBag.ParentTaskID = 0;

            return(PartialView(new task {
                DateEntered = System.DateTime.Today, EnteredBy = User.Identity.Name.ToString(), Status = "Active", goalID = goalID, CompletionRatio = 0, parentTaskID = parentTaskID, ActionItemTypeCode = ActionItemCode
            }));
        }
예제 #2
0
        public ActionResult DeleteConfirmed(int MeetingAgendaID)
        {
            meetingagenda meetingagenda = MeetingAgendaRepository.GetAgendaByID(MeetingAgendaID);

            MeetingAgendaRepository.DeleteRecord(meetingagenda);
            return(RedirectToAction("List"));
        }
예제 #3
0
        public ActionResult Edit(int MeetingAgendaID)
        {
            meetingagenda meetingagenda = MeetingAgendaRepository.GetAgendaByID(MeetingAgendaID);

            GetData(meetingagenda.meetingID);
            return(PartialView(meetingagenda));
        }
예제 #4
0
        public ActionResult Delete(int MeetingAgendaID)
        {
            ViewBag.MeetingAgendaID = MeetingAgendaID;
            meetingagenda meetingagenda = MeetingAgendaRepository.GetAgendaByID(MeetingAgendaID);
            //Delete meeting note
            meetingnote note = MeetingNoteRepository.GetMeetingNotesByAgenda(meetingagenda.meetingAgendaID);

            MeetingNoteRepository.DeleteRecord(note);
            return(PartialView(meetingagenda));
        }
예제 #5
0
        public void AddGeneralAgenda(int meetingID2, string Description, int taskID = 0)
        {
            meetingagenda agenda = new meetingagenda();

            if (taskID > 0)
            {
                task task = TaskRepository.GetTaskByID(taskID);
                agenda.TaskID = taskID;
            }
            agenda.meetingID   = meetingID2;
            agenda.Description = Description;
            agenda.Status      = "Active";
            agenda.EnteredBy   = User.Identity.Name.ToString();
            agenda.DateEntered = DateTime.Now.Date;
            db.meetingagendas.Add(agenda);
            db.SaveChanges();
            MeetingAgendaRepository.AddRecord(agenda);
        }
예제 #6
0
 public ActionResult Edit(meetingagenda meetingagenda)
 {
     try
     {
         //if (contribution.CheckNumber == null) { contribution.CheckNumber = ""; }
         if (ModelState.IsValid)
         {
             db.Entry(meetingagenda).State = EntityState.Modified;
             db.SaveChanges();
             TempData["Message2"] = string.Format("Meeting agenda update successfully.");
             GetData(meetingagenda.meetingID);
             return(RedirectToAction("Edit", new { MeetingAgendaID = meetingagenda.meetingAgendaID }));
         }
     }
     catch (Exception ex)
     {
         TempData["Message2"] = string.Format("Error editing meeting agenda.");
     }
     GetData(meetingagenda.meetingID);
     return(PartialView(meetingagenda));
 }
예제 #7
0
        public ActionResult Create(meetingagenda meetingagenda)
        {
            try
            {
                //if (budget.Comment == null) { budget.Comment = ""; }

                if (ModelState.IsValid)
                {
                    db.meetingagendas.Add(meetingagenda);
                    db.SaveChanges();
                    MeetingAgendaRepository.AddRecord(meetingagenda);
                    TempData["Message2"] = "Meeting agendata created successfully.";
                    GetData(meetingagenda.meetingID);
                    return(RedirectToAction("Create", new { MeetingID = meetingagenda.meetingID, taskID = 0 }));
                }
            }
            catch (Exception ex)
            {
                TempData["Message2"] = "Error adding meeting agenda";
            }
            GetData(meetingagenda.meetingID);

            return(PartialView(meetingagenda));
        }
예제 #8
0
 public void DeleteRecord(meetingagenda record)
 {
     myRecords.Remove(record);
     context.meetingagendas.Remove(record);
     context.SaveChanges();
 }
예제 #9
0
 public meetingagenda GetAgendaByID(int agendaID)
 {
     record = myRecords.FirstOrDefault(e => e.meetingAgendaID == agendaID);
     return(record);
 }
예제 #10
0
 public void AddRecord(meetingagenda Record)
 {
     myRecords.Add(record);
 }