コード例 #1
0
        public ActionResult GetProductosSelect(int idNegocio)
        {
            Negocio_DAL negocioDAL = new Negocio_DAL();
            var         lista      = negocioDAL.GetProductosSelect(idNegocio);

            return(Json(new { lista, JsonRequestBehavior.AllowGet }));
        }
コード例 #2
0
        public ActionResult Propuesta(int id)
        {
            if (!this.currentUser())
            {
                return(RedirectToAction("Ingresar", "Login"));
            }
            if (esUsuario())
            {
                return(RedirectToAction("Index", "Alertas"));
            }
            try
            {
                Usuarios user = getCurrentUser();

                Negocio_DAL negocioDal = new Negocio_DAL();
                ViewBag.lstNegocios  = negocioDal.GetNegociosByUserId(user.id_Usuario);
                ViewBag.lstProductos = new List <Negocio_Producto>();

                Pedido_Propuesta obj = new Pedido_Propuesta();
                if (id > 0)
                {
                    obj = dal.GetPropuesta(id);
                    //obj.IdNegocio = user.id_Usuario;

                    if (obj.IdNegocio > 0)
                    {
                        ViewBag.lstProductos = negocioDal.GetProductos(obj.IdNegocio);
                    }
                    return(View(obj));
                }
                return(View(obj));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }