public ActionResult regservicios(servicios1 newservi)
        {
            if (ModelState.IsValid)
            {
                ConectorDataContext db = new ConectorDataContext();
                ViewBag.lista2 = from a in db.servicios select a;

                var t = db.categorias.ToList();
                ViewBag.cate = t;
                servicio ser = new servicio();

                 db.SubmitChanges();
                int idB = db.categorias.OrderByDescending(a => a.id).First().id;
                ser.idcate = idB;

                ser.servicio_nombre = newservi.servicio;
                ser.precio = newservi.precio;
                Convert.ToString(newservi.categoria);
                string al = newservi.categoria;

                ser.categoria_nombre = al;
                db.servicios.InsertOnSubmit(ser);
                db.SubmitChanges();
                return Redirect("../servicios/regservicios");
            }
            return View();
        }
示例#2
0
		private void detach_servicios(servicio entity)
		{
			this.SendPropertyChanging();
			entity.categoria = null;
		}
示例#3
0
 partial void Updateservicio(servicio instance);
示例#4
0
 partial void Deleteservicio(servicio instance);
示例#5
0
 partial void Insertservicio(servicio instance);