Beispiel #1
0
        public IHttpActionResult PutJobOffer(int id, JobOffer jobOffer)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != jobOffer.JobOfferID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public IHttpActionResult PutTenantAdmin(int id, TenantAdmin tenantAdmin)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tenantAdmin.TenantAdminID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #3
0
 public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Email,Password,organisationName,organisationAddress,organisationPhone,Role")] Recruter recruter)
 {
     if (ModelState.IsValid)
     {
         db.Entry(recruter).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(recruter));
 }
Beispiel #4
0
 public ActionResult Edit([Bind(Include = "TenantAdminID,FirstName,LastName,Email,Password,organisationName,organisationAddress,organisationPhone")] TenantAdmin tenantAdmin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tenantAdmin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tenantAdmin));
 }
Beispiel #5
0
 public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Email,Password,organisationName,organisationAddress,organisationPhone,Role,RewardCredit")] RefferingEmployee refferingEmployee)
 {
     if (ModelState.IsValid)
     {
         HrSmartContext db = new HrSmartContext();
         db.Entry(refferingEmployee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(refferingEmployee));
 }
 public ActionResult Edit([Bind(Include = "JobOfferID,NameJobOffer,Description,StartDate,ExpirationDate,PointGet,RecuterID")] JobOffer jobOffer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(jobOffer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RecuterID = new SelectList(db.Recruters, "Id", "FirstName", jobOffer.RecuterID);
     return(View(jobOffer));
 }
Beispiel #7
0
 public virtual void Update(T entity)
 {
     dbset.Attach(entity);
     dataContext.Entry(entity).State = EntityState.Modified;
 }