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);
        }
Exemplo n.º 2
0
 public void InsertOrUpdate(TeamProject team)
 {
     if (team.TeamID == default(int))
     {
         // New entity
         context.TeamProjects.Add(team);
     }
     else
     {
         // Existing entity
         context.Entry(team).State = EntityState.Modified;
     }
 }
 public void InsertOrUpdate(TeamProject team)
 {
     if (team.TeamID == default(int))
     {
         // New entity
         context.TeamProjects.Add(team);
     }
     else
     {
         // Existing entity
         context.Entry(team).State = EntityState.Modified;
     }
 }
 public ActionResult TeamAssigned(TeamProject team)
 {
     return View(team);
 }