示例#1
0
        // GET: Project
        public ActionResult ProjectDetails()
        {
            string Username = HttpContext.Session["Uname"].ToString();

            UserModel um = db.Umodel.Where(id => id.Username
                                           == Username).First();


            Project p = db.Proj.Where(Pid => Pid.Pid == um.CurrentProj).First();

            Project_Members pm = new Project_Members();

            List <ProjectMembers> Pmem = db.Pmembers.Where(id => id.Pid
                                                           == p.Pid).ToList();

            List <UserModel> users = new List <UserModel>();

            List <ProjectNotification> SuggestedUserList = db.ProjNot.Where(ID => ID.Pid == p.Pid).ToList();

            //  Debug.WriteLine("ddddddddddddddddddddd" + SuggestedUserList[0].MemSug);
            List <UserModel> list = db.Umodel.Where(ID => ID.Status == "Free" && ID.Skills.Contains(p.tech)).ToList();

            List <UserModel> Candidlist = new List <UserModel>();

            foreach (var UserList in list)
            {
                bool check = true;
                foreach (var SugList in SuggestedUserList)
                {
                    if (UserList.Username == SugList.MemSug)
                    {
                        check = false;
                        break;
                    }
                }

                if (check)
                {
                    //  Debug.WriteLine("UserList.Username " + UserList.Username );
                    Candidlist.Add(UserList);
                }
            }
            // Debug.WriteLine("ddddddddddddddddddddd"+Candidlist[0].FirstName);



            foreach (var item in Pmem)
            {
                users.Add(db.Umodel.Single(id => id.Username == item.Uname));
            }

            pm.CandidList = Candidlist;
            pm.proj       = p;
            pm.UmodelList = users;
            pm.Umodel     = um;
            return(View(pm));
        }
示例#2
0
        public ActionResult RemoveMember(int Id, string Project_Name)
        {
            Project_Members p1 = context.Project_Members.Find(Id);

            p1.is_Deleted   = true;
            p1.Updated_Date = DateTime.Now;
            context.SaveChanges();


            return(PartialView("DisplayMembers", GetMembers(Project_Name)));
        }
示例#3
0
 public ActionResult Add_Users_To_Project(string project, string Member)
 {
     if (context.Project_Members.Where(x => x.Project_Name == project && x.Member_Id == Member && x.is_Deleted == false).Count() > 0 || project == null || project == string.Empty || Member == null || Member == string.Empty)
     {
         ViewBag.added = true;
         return(Json(new { result = false }, JsonRequestBehavior.AllowGet));
     }
     else
     {
         Project_Members member = new Project_Members();
         member.Member_Id    = Member;
         member.Project_Name = project;
         member.is_Deleted   = false;
         member.Updated_Date = DateTime.Now;
         context.Project_Members.Add(member);
         context.SaveChanges();
         return(PartialView("DisplayMembers", GetMembers(project)));
     }
 }