Exemplo n.º 1
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));
        }
        public IHttpActionResult PutRefferingEmployee(int id, RefferingEmployee refferingEmployee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

            service.Updatereffering(refferingEmployee);

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 3
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));
        }
Exemplo n.º 4
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));
 }
Exemplo n.º 5
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));
 }
        public ActionResult Create([Bind(Include = "Id,FirstName,LastName,Email,Password,organisationName,organisationAddress,organisationPhone,Role,RewardCredit")] RefferingEmployee refferingEmployee)
        {
            if (ModelState.IsValid)
            {
                db.Refferings.Add(refferingEmployee);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(refferingEmployee));
        }
Exemplo n.º 7
0
 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));
 }
Exemplo n.º 8
0
        public ActionResult DeleteConfirmed(int id)
        {
            HrSmartContext    db = new HrSmartContext();
            RefferingEmployee refferingEmployee = db.Refferings.Find(id);

            db.Refferings.Remove(refferingEmployee);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 9
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));
 }