コード例 #1
0
        public JsonResult AutoComplete(string term)
        {
            PMTDBContext     context   = new PMTDBContext();
            List <string>    user_name = new List <string>();
            List <User_Info> clist     = context.UserInfo.Where(c => c.Name.Contains(term)).ToList();

            foreach (var c in clist)
            {
                user_name.Add(c.Name);
            }

            return(Json(user_name, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult assign_Task(FormCollection collection)
        {
            string      projectId   = collection["projectId"];
            string      userId      = collection["userId"];
            string      description = collection["description"];
            string      due_date    = collection["due_date"];
            string      priority    = collection["priority"];
            Assign_Task at          = new Assign_Task();

            at.ProjectId = Int32.Parse(projectId);
            at.RUserId   = Int32.Parse(userId);
            at.TaskName  = description;
            at.DueDate   = DateTime.Parse(due_date);
            at.Priority  = projectId;
            User_Info u = (User_Info)Session["user"];

            at.GUserId = u.Id;
            PMTDBContext contex = new PMTDBContext();

            contex.AssignTasks.Add(at);
            contex.SaveChanges();
            return(RedirectToAction("View_Task"));
        }