public ActionResult DeleteConfirmed(int id)
        {
            parcelHandler parcelHandler = db.parcelHandlers.Find(id);

            db.parcelHandlers.Remove(parcelHandler);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,employeeName,employeeMidName,employeeSurname,employeeIdNumber,employeeEmail,employeePhonenumber,employeeProfilePic,employeeCv,employeeIdDocument,employeeQualification,country,street_number,route,administrative_area_level_1,locality,postal_code,fullAdress,isStillEmployeed,reasonLeft,addedByEmail,dateRegistered")] parcelHandler parcelHandler)
 {
     if (ModelState.IsValid)
     {
         db.Entry(parcelHandler).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(parcelHandler));
 }
        // GET: parcelHandlers/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            parcelHandler parcelHandler = db.parcelHandlers.Find(id);

            if (parcelHandler == null)
            {
                return(HttpNotFound());
            }
            return(View(parcelHandler));
        }
        public ActionResult Create([Bind(Include = "id,employeeName,employeeMidName,employeeSurname,employeeIdNumber,employeeEmail,employeePhonenumber" +
                                                   ",employeeProfilePic,employeeCv,employeeIdDocument,employeeQualification,country,street_number,route,administrative_area_level_1" +
                                                   ",locality,postal_code,fullAdress,isStillEmployeed,reasonLeft,addedByEmail,dateRegistered")] parcelHandler parcelHandler, HttpPostedFileBase profPic, HttpPostedFileBase qualification, HttpPostedFileBase idDoc, HttpPostedFileBase cvDoc)
        {
            parcelHandler.employeeCv         = uploader.getFileByte(cvDoc);
            parcelHandler.employeeIdDocument = uploader.getFileByte(idDoc);
            parcelHandler.employeeProfilePic = uploader.getFileByte(profPic);
            parcelHandler.dateRegistered     = DateTime.Now.ToString();
            parcelHandler.isStillEmployeed   = true;
            if (qualification != null)
            {
                parcelHandler.employeeQualification = uploader.getFileByte(qualification);
            }
            if (ModelState.IsValid)
            {
                db.parcelHandlers.Add(parcelHandler);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(parcelHandler));
        }