예제 #1
0
        public IHttpActionResult PutJobAd(int id, JobAd jobAd)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != jobAd.Id)
            {
                return(BadRequest());
            }

            db.Entry(jobAd).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!JobAdExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult Create([Bind(Include = "Id,ApplyStatus")] Apply apply)
        {
            if (ModelState.IsValid)
            {
                db.Applies.Add(apply);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(apply));
        }
        public ActionResult Create([Bind(Include = "Id,Position,ImageUrl,StudentProfile,Location,CreateOn,ValidUntil,Description,IsDeleted")] JobAd jobAd)
        {
            if (ModelState.IsValid)
            {
                db.JobAds.Add(jobAd);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(jobAd));
        }
예제 #4
0
        public ActionResult Create([Bind(Include = "Id,CreatedDate,RequiredByDate,TaskDescription,TaskStatus,TaskType,NextActionDate,UserID")] TaskModel taskModel)
        {
            if (ModelState.IsValid)
            {
                db.Tasks.Add(taskModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.UserID = new SelectList(db.Users, "Id", "Email", taskModel.UserID);
            return(View(taskModel));
        }