コード例 #1
0
 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());;
 }
コード例 #2
0
 public ActionResult Statistics()
 {
     try
     {
         ViewBag.NoOfUser = context.Set <User>().Count();
         ViewBag.NoOfJobs = context.Set <JobList>().Count();
         return(View());
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #3
0
ファイル: LoginController.cs プロジェクト: jamijoy/JobHorizon
 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"));
     }
 }
コード例 #4
0
 public IEnumerable <JobHistory> GetApprovedJob(int id)
 {
     return(context.Set <JobHistory>().Where(x => x.JobList.PostedBy == id && x.Status == "Pending"));
 }
コード例 #5
0
 public IEnumerable <JobList> JobForWorker(string type)
 {
     return(context.Set <JobList>().Where(x => x.JobType == type && x.Status == "Active").ToList());
 }
コード例 #6
0
 public IEnumerable <TEntity> GetAll()
 {
     return(context.Set <TEntity>().ToList());
 }
コード例 #7
0
        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());
        }
コード例 #8
0
ファイル: BidRepository.cs プロジェクト: jamijoy/JobHorizon
 public IEnumerable <BidList> GetBidList(int id)
 {
     return(context.Set <BidList>().Where(x => x.JobId == id).ToList());
 }
コード例 #9
0
 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());
 }