예제 #1
0
 public ActionResult Edit(Company company)
 {
     if (ModelState.IsValid)
     {
         db.Entry(company).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(company);
 }
예제 #2
0
        public ActionResult Create(Company company)
        {
            if (ModelState.IsValid)
            {
                db.Companies.Add(company);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(company);
        }
예제 #3
0
 public void SetDataFromCompany(Company c, LunchArea area)
 {
     this.Name = c.Name;
     this.Adress = c.Adress;
     this.Company = c;
     this.Email = c.Email;
     this.Information = c.Information;
     this.Url = c.Url;
     if (!Areas.Any(a => a.Id == area.Id))
     {
         this.Areas.Add(area);
     }
 }