public ActionResult regMantencion(mantencion newmantencion)
        {
            if (ModelState.IsValid)
            {
            ConectorDataContext db = new ConectorDataContext();
            var t = db.habitacions.ToList();
            ViewBag.habit = t;

            mantenimiento man = new mantenimiento();

            int idC = db.habitacions.OrderByDescending(a => a.id).First().id;
            man.idhabi = idC;
            man.fechaini = newmantencion.fecha;
            man.fechafin = newmantencion.fecha2;

            db.mantenimientos.InsertOnSubmit(man);
            db.SubmitChanges();

            return Redirect("../habitaciones/mostrarmantencion");
            }
            return View();
        }
예제 #2
0
 partial void Deletemantenimiento(mantenimiento instance);
예제 #3
0
 partial void Insertmantenimiento(mantenimiento instance);
예제 #4
0
 partial void Updatemantenimiento(mantenimiento instance);
예제 #5
0
		private void detach_mantenimientos(mantenimiento entity)
		{
			this.SendPropertyChanging();
			entity.habitacion = null;
		}