public ActionResult DeleteConfirmed(int id)
        {
            jobdetail jobdetail = db.jobdetails.Find(id);

            db.jobdetails.Remove(jobdetail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public JsonResult Edit(jobdetail job)
 {
     using (jQueryAjaxEntities db = new jQueryAjaxEntities())
     {
         db.Entry(job).State = EntityState.Modified;
         db.SaveChanges();
     }
     return(Json("Success", JsonRequestBehavior.AllowGet));
 }
Exemple #3
0
 public JsonResult AddJob(jobdetail job)
 {
     using (jQueryAjaxEntities db = new jQueryAjaxEntities())
     {
         db.jobdetails.Add(job);
         db.SaveChanges();
         return(Json("Success"));
     }
 }
Exemple #4
0
 public JsonResult Delete(int id)
 {
     using (jQueryAjaxEntities db = new jQueryAjaxEntities())
     {
         jobdetail job = db.jobdetails.Where(x => x.JobID == id).FirstOrDefault <jobdetail>();
         db.jobdetails.Remove(job);
         db.SaveChanges();
     }
     return(Json("Success", JsonRequestBehavior.AllowGet));
 }
Exemple #5
0
        public ActionResult Edit(int?id)
        {
            jobdetail job = new jobdetail();

            using (jQueryAjaxEntities db = new jQueryAjaxEntities())
            {
                job = db.jobdetails.Where(x => x.JobID == id).FirstOrDefault <jobdetail>();
            }
            return(View(job));
        }
 public ActionResult Edit([Bind(Include = "JDID,LastName,FirstName,Email,phone,gender,address,description,cv,DateEnd")] jobdetail jobdetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(jobdetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(jobdetail));
 }
        // GET: jobdetails/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            jobdetail jobdetail = db.jobdetails.Find(id);

            if (jobdetail == null)
            {
                return(HttpNotFound());
            }
            return(View(jobdetail));
        }
        public ActionResult Create(jobdetail model, HttpPostedFileBase ImageFile)
        {
            if (ModelState.IsValid)
            {
                string imageName = string.Empty;
                string fileName  = string.Empty;
                String FileExt   = Path.GetExtension(model.File.FileName).ToUpper();

                if (FileExt == ".PDF" || FileExt == ".DOCX")
                {
                    string subPath = "/Content/CV"; // your code goes here

                    bool exists = System.IO.Directory.Exists(Server.MapPath(subPath));

                    if (!exists)
                    {
                        System.IO.Directory.CreateDirectory(Server.MapPath(subPath));
                    }

                    if (model.File != null)
                    {
                        fileName = Path.GetFileNameWithoutExtension(model.File.FileName);
                        string extension2 = Path.GetExtension(model.File.FileName);

                        model.FileName      = fileName + DateTime.Now.ToString("yymmssfff");
                        model.FileExtension = extension2;
                        fileName            = model.FileName + extension2;

                        model.FilePath = "/Content/CV/" + fileName;
                        fileName       = Path.Combine(Server.MapPath("~/Content/CV/"), fileName);
                        model.File.SaveAs(fileName);
                    }
                    if (model != null)
                    {
                        db.Entry(model).State = EntityState.Modified;
                        model.DateEnd         = System.DateTime.Now;
                        db.jobdetails.Add(model);
                        db.SaveChanges();
                        return(RedirectToAction("index", "jobs"));
                    }
                }
            }

            return(PartialView(model));
        }