Esempio n. 1
0
        public ActionResult Create([Bind(Include = "CompanyId,CompanyName,CompanyAdress,CompanyDescription")] Company company)
        {
            if (ModelState.IsValid)
            {
                db.Companies.Add(company);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(company));
        }
Esempio n. 2
0
        public ActionResult Create([Bind(Include = "JobId,JobName,JobDescription,JobLocation,JobPosiotion,CompanyId,JobPublishedDate")] Job job)
        {
            if (ModelState.IsValid)
            {
                db.Jobs.Add(job);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CompanyId = new SelectList(db.Companies, "CompanyId", "CompanyName", job.CompanyId);
            return(View(job));
        }