Exemplo n.º 1
0
        public ActionResult Create([Bind(Include = "AptId,AptAddress,SqFootage,MonthUtilityFee,MonthParkfee,LastCleanDate,IsVacant")] Apartment apartment)
        {
            if (ModelState.IsValid)
            {
                db.Apartments.Add(apartment);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(apartment));
        }
Exemplo n.º 2
0
        public ActionResult Create([Bind(Include = "TenantId,FirstName,LastName,Phone,Email")] Tenant tenant)
        {
            if (ModelState.IsValid)
            {
                db.Tenants.Add(tenant);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tenant));
        }
Exemplo n.º 3
0
        public JsonResult PostWork(AptWorkVM WorkJson)
        {
            ApartmentEntities aptDB = new ApartmentEntities();
            Apt_Work          work  = new Apt_Work();

            work.User_ID   = WorkJson.Userid;
            work.Task_ID   = WorkJson.TaskId;
            work.Work_Date = DateTime.Now;
            aptDB.Apt_Work.Add(work);
            aptDB.SaveChanges();
            return(Json("success"));
        }