예제 #1
0
        public ActionResult Assign(int KWTaskID, string StaffProfileName)
        {
            bool verify;
            var  task        = taskRepo.GetKWTaskByID(KWTaskID);
            var  allProfiles = staffRepo.GetAllStaffProfiles().ToList();

            if (StaffProfileName != "Clear")
            {
                string[] name    = StaffProfileName.Split(' ');
                var      profile = staffRepo.GetStaffProfileByFullName(name[0], name[1]) as StaffProfile;
                verify = ProcessAssign(task, allProfiles, profile);

                if (verify)
                {
                    return(RedirectToAction("AllKWTasks"));
                }
                else
                {
                    ModelState.AddModelError("", "Task Not Found");
                }
            }
            else
            {
                verify = ProcessAssign(task, allProfiles, true);
            }

            return(RedirectToAction("AllKWTasks"));
        }
예제 #2
0
        //[HttpPost]
        public IActionResult AddInteraction(int BrokerID)
        {
            var broker = brokerRepo.GetBrokerByID(BrokerID);

            var NewInteraction = new Interaction();

            broker.Interactions.Add(NewInteraction);

            var profile = staffRepo.GetStaffProfileByFullName(Helper.StaffProfileLoggedIn.FirstName, Helper.StaffProfileLoggedIn.LastName);

            profile.Interactions.Add(NewInteraction);


            intRepo.AddInteraction(NewInteraction);

            //TODO: See if there is a way to just close the modal and not refresh the page
            return(RedirectToAction("BrokerInteractions", new { BrokerID = BrokerID }));
        }