public ActionResult CreateB(Blog b) { Blog blog = new BusGlobal().CreateBlog(b); Response.StatusCode = 200; Response.StatusDescription = "Objeto creado"; return(Json(b, "application/json", JsonRequestBehavior.AllowGet)); }
public ActionResult CreateS(Servicio s) { Servicio serv = new BusGlobal().CreateServicio(s); Response.StatusCode = 200; Response.StatusDescription = "Objeto creado"; return(Json(s, "application/json", JsonRequestBehavior.AllowGet)); }
public ActionResult CreateP(Proyecto p) { p.img_proyecto = "proye1.png"; Proyecto proye = new BusGlobal().CreateProyecto(p); Response.StatusCode = 200; Response.StatusDescription = "Objeto creado"; return(Json(proye, "application/json", JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage PutServicio(int idp, Servicio serv) { var servicio = new BusGlobal().UpdateServicio(serv); if (servicio > 0) { return(Request.CreateResponse(HttpStatusCode.Accepted, servicio)); } return(Request.CreateResponse(HttpStatusCode.NotModified, false)); }
public HttpResponseMessage PostSlider(Slider slider) { Slider slid = new BusGlobal().CreateSlider(slider); if (slid != null) { return(Request.CreateResponse(HttpStatusCode.Created, slid)); } return(Request.CreateResponse(HttpStatusCode.OK, false)); }
public HttpResponseMessage PutBlog(int idp, Blog blog) { var blo = new BusGlobal().UpdateBlog(blog); if (blo > 0) { return(Request.CreateResponse(HttpStatusCode.Accepted, blo)); } return(Request.CreateResponse(HttpStatusCode.NotModified, false)); }
public HttpResponseMessage PostServicio(Servicio serv) { Servicio servicio = new BusGlobal().CreateServicio(serv); if (servicio != null) { return(Request.CreateResponse(HttpStatusCode.Created, servicio)); } return(Request.CreateResponse(HttpStatusCode.OK, false)); }
public HttpResponseMessage DeleteProyecto(int idp) { int proyecto = new BusGlobal().DeleteProyecto(idp); if (proyecto > 0) { return(Request.CreateResponse(HttpStatusCode.OK, proyecto)); } return(Request.CreateResponse(HttpStatusCode.Conflict, false)); }
public HttpResponseMessage PutSlider(int idp, Slider slider) { int slid = new BusGlobal().UpdateSlider(slider); if (slid > 0) { return(Request.CreateResponse(HttpStatusCode.Accepted, slid)); } return(Request.CreateResponse(HttpStatusCode.NotModified, false)); }
public HttpResponseMessage PutProyecto(int idp, Proyecto proye) { int proyecto = new BusGlobal().UpdateProyecto(proye); if (proyecto > 0) { return(Request.CreateResponse(HttpStatusCode.Accepted, proyecto)); } return(Request.CreateResponse(HttpStatusCode.NotModified, false)); }
public HttpResponseMessage PostProyecto(Proyecto proye) { Proyecto proyecto = new BusGlobal().CreateProyecto(proye); if (proyecto != null) { return(Request.CreateResponse(HttpStatusCode.Created, proyecto)); } return(Request.CreateResponse(HttpStatusCode.OK, false)); }
public HttpResponseMessage DeleteSlider(int idp) { int slider = new BusGlobal().DeleteSlider(idp); if (slider > 0) { return(Request.CreateResponse(HttpStatusCode.OK, slider)); } return(Request.CreateResponse(HttpStatusCode.Conflict, false)); }
public HttpResponseMessage DeleteBlog(int idp) { int blog = new BusGlobal().DeleteBlog(idp); if (blog > 0) { return(Request.CreateResponse(HttpStatusCode.OK, blog)); } return(Request.CreateResponse(HttpStatusCode.Conflict, false)); }
public HttpResponseMessage DeleteServicio(int idp) { int servicio = new BusGlobal().DeleteServicio(idp); if (servicio > 0) { return(Request.CreateResponse(HttpStatusCode.OK, servicio)); } return(Request.CreateResponse(HttpStatusCode.Conflict, false)); }
public HttpResponseMessage GetProyecto(int idp) { var lst = new BusGlobal().GetProyectos(); Proyecto proye = lst.FirstOrDefault(s => s.id_proyecto == idp); if (proye == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.OK, proye)); }
public HttpResponseMessage GetBlog(int idp) { var lst = new BusGlobal().GetBlogs(); Blog blog = lst.FirstOrDefault(b => b.id_blog == idp); if (blog == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.OK, blog)); }
public HttpResponseMessage GetSlider(int idp) { var lst = new BusGlobal().GetSliders(); Slider slider = lst.FirstOrDefault(s => s.id_slider == idp); if (lst == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.OK, slider)); }
public HttpResponseMessage GetServicio(int idp) { var lst = new BusGlobal().GetServicios(); Servicio serv = lst.FirstOrDefault(s => s.id_serv == idp); if (serv == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.OK, serv)); }
public async Task <IHttpActionResult> Add(Blog blog) { try { blog.fecha_blog = DateTime.Now; Blog newBlog = new BusGlobal().CreateBlog(blog); return(Ok(new { newBlog })); } catch (Exception ex) { return(BadRequest(ex.GetBaseException().Message)); } }
public ActionResult Index() { Usuario user = (Usuario)Session["Usuario"]; if (user != null) { IndexModelo lst = new BusGlobal().GetModeloIndex(); return(View(lst)); } else { return(RedirectToAction("Login")); } }
public ActionResult Login(Usuario user) { Usuario usuario = new BusGlobal().GetUsuario(user.nombre_usua, user.pass_usua); if (usuario != null && usuario.estatus_usua) { Session["Usuario"] = usuario; return(RedirectToAction("Index")); } else if (usuario != null) { ViewBag.MostrarError = true; ViewBag.Error = $"Tu cuenta {usuario.nombre_usua} ha sido des habilitada, contacta al administrador."; return(View()); } else { ViewBag.MostrarError = true; ViewBag.Error = $"Usuario y/o password no vĂ¡lido."; return(View()); } }
protected void ddlProyectos_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlProyectos.SelectedValue != "" && ddlProyectos.SelectedValue != null) { int idProyecto = Convert.ToInt32(ddlProyectos.SelectedValue); Proyecto proye = new BusGlobal().GetProyecto(idProyecto); proye.fecha_proyecto = DateTime.Now; txtNombre.Text = proye.nombre_proyecto; txtId.Value = proye.id_proyecto.ToString(); txtDescripcion.Text = proye.desc_proyecto; txtImg.Text = proye.img_proyecto.ToString(); //txtDate.Text = proye.fecha_proyecto.ToDate.Now(); txtCosto.Text = proye.costo_proyecto.ToString(); BtnGuardar.Text = "Actualizar"; BtnDelete.Visible = true; } else { txtNombre.Text = ""; txtId.Value = ""; txtDescripcion.Text = ""; //txtDate.Text = ""; txtCosto.Text = ""; BtnGuardar.Text = "Guardar"; BtnDelete.Visible = false; } } catch (Exception ex) { MostrarMensaje(ex.Message); } }
public ActionResult Proyectos() { List <Proyecto> lst = new BusGlobal().GetProyectos(); return(View(lst)); }
public ActionResult Blog() { List <Blog> lst = new BusGlobal().GetBlogs(); return(View(lst)); }
public ActionResult About() { List <Testimonio> lst = new BusGlobal().GetTestimonios(); return(View(lst)); }
public HttpResponseMessage GetProyectos() { var lst = new BusGlobal().GetProyectos(); return(Request.CreateResponse(HttpStatusCode.OK, lst)); }
public ActionResult Servicios() { List <Servicio> lst = new BusGlobal().GetServicios(); return(View(lst)); }