Пример #1
0
        public ActionResult Create(Project project)
        {
            if (ModelState.IsValid)
            {
                project.ConfirmDate = DateTime.Now.Date;
                context.Projects.Add(project);
                context.SaveChanges();
                // return RedirectToAction("Index");
            }

            ViewBag.PossibleEnquiries = context.Enquiries;
            return(View(project));
        }
Пример #2
0
        public ActionResult Assign(FormCollection col)
        {
            int    enquiryId    = Convert.ToInt32(col.GetValue("Enquiry").AttemptedValue);
            int    projectId    = Convert.ToInt32(col.GetValue("Project").AttemptedValue);
            int    TeamType     = Convert.ToInt32(col.GetValue("TeamType").AttemptedValue);
            string TeamTypeName = (TeamType == 1)?"Non Kenwood Team":"Kenwood Team";
            string TeamName     = String.Empty;

            if (TeamType == 1)
            {
                TeamName = col.GetValue("Non_Kenwood").AttemptedValue.ToString();
            }
            else
            {
                TeamName = teamRepository.Find(Convert.ToInt32(col.GetValue("Team").AttemptedValue)).TeamName;
            }
            TeamProject team = new TeamProject();

            team.ProjectID = projectId;
            team.TeamID    = Convert.ToInt32(col.GetValue("Team").AttemptedValue);
            BusinessFlowContext context = new BusinessFlowContext();

            context.TeamProjects.Add(team);
            context.SaveChanges();

            return(RedirectToAction("TeamAssigned", team));
        }