Ejemplo n.º 1
0
 public static void CreateNewAppartment(AppartmentCreateModel model)
 {
     using (AppartmentContext db = new AppartmentContext())
     {
         var address = model.Street + " " + model.HomeNumber + (!string.IsNullOrEmpty(model.Building) ? "/" + model.Building : "") + " " + model.Room;
         db.Appartments.Add(new Entities.Appartment()
         {
             Address = address
         });
         db.SaveChanges();
     }
     return;
 }
Ejemplo n.º 2
0
 public ActionResult CreateNewAppartment(AppartmentCreateModel model)
 {
     FunctionWithDB.CreateNewAppartment(model);
     return(RedirectToAction("Index"));
 }