public IEnumerable <Messege> GEtConnectedPeople(int id) { return(context.Set <Messege>() .Where(e => id == e.ReceiverId || id == e.SenderId) .GroupBy(e => new { e.ReceiverId, e.SenderId }) .Select(g => g.FirstOrDefault()) .Distinct() .ToList());; }
public ActionResult Statistics() { try { ViewBag.NoOfUser = context.Set <User>().Count(); ViewBag.NoOfJobs = context.Set <JobList>().Count(); return(View()); } catch (Exception) { throw; } }
public ActionResult Index(User u) { try { var login = context.Set <User>().SingleOrDefault(x => x.Email == u.Email && x.Password == u.Password); if (login != null) { //return Content(login.ToString()); Session["UserId"] = login.UserId; Session["UserType"] = login.Type; Session["WorkType"] = login.WorkType; return(RedirectToAction("UserCheck", "User")); } else { TempData["Error"] = "Login Attempt Failed"; return(RedirectToAction("Index")); } } catch (Exception e) { TempData["Error"] = "Login Attempt Failed"; return(RedirectToAction("Index")); } }
public IEnumerable <JobHistory> GetApprovedJob(int id) { return(context.Set <JobHistory>().Where(x => x.JobList.PostedBy == id && x.Status == "Pending")); }
public IEnumerable <JobList> JobForWorker(string type) { return(context.Set <JobList>().Where(x => x.JobType == type && x.Status == "Active").ToList()); }
public IEnumerable <TEntity> GetAll() { return(context.Set <TEntity>().ToList()); }
public IEnumerable <User> GetConnectedPeople(int MyId) { var connection = context.Set <Messege>().FirstOrDefault(x => x.ReceiverId == MyId); return(context.Set <User>().Where(x => x.UserId == MyId).ToList()); }
public IEnumerable <BidList> GetBidList(int id) { return(context.Set <BidList>().Where(x => x.JobId == id).ToList()); }
public IEnumerable <JobList> JobForWorker(string type) { // context.set.where.ToList(); // context.set<Repository_Name>.where(Condition).ToList(); return(context.Set <JobList>().Where(x => x.JobType == type && x.Status == "Active").ToList()); }