Ejemplo n.º 1
0
 public ActionResult InputDetails(UserDetails userDetails)
 {
     using (Entities db = new Entities())
     {
         var val = db.interviewees.Where(m => m.Mail == userDetails.Mail).FirstOrDefault();
         if (val == null)
         {
             var data = new interviewee
             {
                 Mail        = userDetails.Mail,
                 PhoneNumber = userDetails.PhoneNumber,
                 JobID       = userDetails.JobId
             };
             db.interviewees.Add(data);
             db.SaveChanges();
             return(RedirectToAction("Contact", "Home"));
         }
         else
         {
             userDetails.IntervieweeErrorMsg = "Mail ID is Alredy Exist";
             TempData["alertMessage"]        = userDetails.IntervieweeErrorMsg;
             return(RedirectToAction("Home", "Home", userDetails));
         }
     }
 }
Ejemplo n.º 2
0
        public IHttpActionResult Getinterviewee(int id)
        {
            interviewee interviewee = db.interviewee.Find(id);

            if (interviewee == null)
            {
                return(NotFound());
            }

            return(Ok(interviewee));
        }
Ejemplo n.º 3
0
        public IHttpActionResult Getinterviewee(string id)
        {
            interviewee interviewee = db.interviewee.Where(t1 => t1.uid == id).FirstOrDefault();

            if (interviewee == null)
            {
                return(NotFound());
            }

            return(Ok(interviewee));
        }
Ejemplo n.º 4
0
        public IHttpActionResult Postinterviewee(string name)
        {
            interviewee interviewee = new interviewee()
            {
                name = name
            };

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.interviewee.Add(interviewee);
            db.SaveChanges();

            return(Ok(interviewee.id));
        }