Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CarritoNegocio negocio = new CarritoNegocio();
            EstadoNegocio  en      = new EstadoNegocio();
            List <Carrito> lista;

            try
            {
                lista   = negocio.Listar();
                estados = en.Listar();

                var Seleccionado = Convert.ToInt32(Request.QueryString["idven"]);
                carrito           = lista.Find(J => J.Id == Seleccionado);
                carrito.Articulos = negocio.GetArticulosCarrito(carrito.Id);


                var estado = Convert.ToInt32(Request.QueryString["idestado"]);
                if (estado != 0)
                {
                    en.Modificar(estado, carrito.Id);
                    Response.Redirect("~/DetalleVenta.aspx?idven=" + carrito.Id, false);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                Response.Redirect("~/Error.aspx");
            }
        }
Exemplo n.º 2
0
        public IHttpActionResult EliminarEstado(int id)
        {
            try
            {
                EstadoNegocio auxEstado = new EstadoNegocio();
                string        mensaje   = auxEstado.EliminarEstado(id);

                Response response = new Response
                {
                    Code    = 200,
                    Message = mensaje
                };

                return(Ok(response));
            }
            catch (Exception ex)
            {
                Response response = new Response
                {
                    Code    = 400,
                    Message = ex.Message
                };

                return(Ok(response));
            }
        }
Exemplo n.º 3
0
        public IHttpActionResult AgregarEstado([FromBody] Estado estado)
        {
            try
            {
                EstadoNegocio auxEstado = new EstadoNegocio();
                string        mensaje   = auxEstado.AgregarEstado(estado);

                Response response = new Response
                {
                    Code    = 200,
                    Message = mensaje
                };
                return(Ok(response));
            }
            catch (Exception ex)
            {
                Response response = new Response
                {
                    Code    = 400,
                    Message = ex.Message
                };

                return(Ok(response));
            }
        }
Exemplo n.º 4
0
        public IHttpActionResult ObteneEstado()
        {
            try
            {
                EstadoNegocio auxEstado = new EstadoNegocio();
                List <Estado> estados   = auxEstado.ObtenerEstados();

                Response response = new Response
                {
                    Code    = 200,
                    Message = "Estados",
                    Data    = estados
                };
                return(Ok(response));
            }
            catch (Exception ex)
            {
                Response response = new Response
                {
                    Code    = 400,
                    Message = ex.Message
                };

                return(Ok(response));
            }
        }
Exemplo n.º 5
0
        public IHttpActionResult ActualizarEstado(Estado estado)
        {
            try
            {
                EstadoNegocio auxIngrediente = new EstadoNegocio();
                string        message        = auxIngrediente.ActualizarEstado(estado);

                Response response = new Response
                {
                    Code    = 200,
                    Message = message
                };
                return(Ok(response));
            }
            catch (Exception ex)
            {
                Response response = new Response
                {
                    Code    = 400,
                    Message = ex.Message
                };

                return(Ok(response));
            }
        }
        public ActionResult DetallePedido(long idPedido = 0)
        {
            EstadoNegocio estadoNegocio = new EstadoNegocio();
            List <Estado> estado;

            estado         = estadoNegocio.Listar();
            ViewBag.Estado = estado;

            DetalleCarritoNegocio detalleCarritoNegocio = new DetalleCarritoNegocio();

            DetalleCarrito        detalleCarrito;
            List <DetalleCarrito> listaDetalle;
            Pedido        pedido;
            PedidoNegocio pedidoNegocio = new PedidoNegocio();

            pedido = pedidoNegocio.BuscarPorId(idPedido);

            listaDetalle = detalleCarritoNegocio.BuscadorDeLong(idPedido);


            pedido.listaDetalle = listaDetalle;



            Usuario usuario;

            usuario = (Usuario)Session["user"];


            ViewBag.usuario = usuario;

            return(View(pedido)); // estoy mandando el model (el objeto a la vista)
        }
Exemplo n.º 7
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            EstadoNegocio estadoNegocio = new EstadoNegocio();
            Estado        objNegocio    = new Estado();
            Estado        obj           = new Estado();

            try
            {
                objNegocio.Nombre = txtcNombre.Text.ToUpper();
                if (txtcNombre.Text == "")
                {
                    throw new Exception("Error nombre del estado no puede estar en blanco");
                }

                obj = estadoNegocio.obtenerEstado().Find(x => x.Nombre == objNegocio.Nombre);
                if (obj == null)
                {
                    estadoNegocio.insertarEstado(objNegocio);
                    Response.Redirect("WebEstado.aspx");
                }
                else
                {
                    throw new Exception("Error ya existe ese nombre del estado");
                }
            }
            catch (Exception ex)
            {
                lblModalTitle.Text = "Validación";
                lblModalBody.Text  = ex.Message;
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "openModal();", true);
            }
        }
Exemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MunicipioNegocio negocioMunicipio = new MunicipioNegocio();
            EstadoNegocio    negocioEstado    = new EstadoNegocio();
            Estado           objEstado        = new Estado();

            if (Session["ID"] == null)
            {
                GridViewRow datos = (GridViewRow)Session["gvr"];
                lblID.Text = datos.Cells[0].Text;
            }
            else
            {
                lblID.Text = Session["ID"] as string;
            }

            try
            {
                int idEstado = Convert.ToInt32(lblID.Text.ToString());
                objEstado = negocioEstado.obtenerEstado().Find(x => x.idEstado == idEstado);

                lblNombreEstado.Text = objEstado.Nombre;

                GridViewMunicipio.DataSource = negocioMunicipio.obtenerMunicipio(idEstado);
                GridViewMunicipio.DataBind();
            }
            catch (Exception ex)
            {
                throw new Exception("Error en la consulta" + ex.Message);
            }
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VentaNegocio       ventaNegocio       = new VentaNegocio();
            CarritoUserNegocio carritoUserNegocio = new CarritoUserNegocio();
            UsuarioNegocio     usuarioNegocio     = new UsuarioNegocio();
            EstadoNegocio      estadoNegocio      = new EstadoNegocio();

            try
            {
                venta                   = ventaNegocio.Listar().Find(v => v.ID == Convert.ToInt64(Request.QueryString["ID"]));
                venta.Usuario           = usuarioNegocio.ListarClientes().Find(u => u.ID == venta.Usuario.ID);
                venta.Carrito.Productos = carritoUserNegocio.CargarListaCarrito(venta.Carrito.ID);
                listaProductos          = venta.Carrito.Productos;
                if (!IsPostBack)
                {
                    dropDownEstado.DataSource     = estadoNegocio.Listar();
                    dropDownEstado.DataValueField = "ID";
                    dropDownEstado.DataTextField  = "Nombre";
                    dropDownEstado.SelectedIndex  = venta.Estado.ID - 1;
                    dropDownEstado.DataBind();
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("Error.aspx");
            }
        }
Exemplo n.º 10
0
        public void traerEstados()
        {
            EstadoNegocio negocioEstado = new EstadoNegocio();

            listaEstados              = negocioEstado.ObtieneEstados();
            cmbEstados.DataSource     = listaEstados;
            cmbEstados.DataTextField  = "NB_ESTADO";
            cmbEstados.DataValueField = "CL_ESTADO";
            cmbEstados.DataBind();
        }
Exemplo n.º 11
0
        public ActionResult BajaLogicaEstado(int idAux)
        {
            EstadoNegocio estado        = new EstadoNegocio();
            List <Estado> listaOriginal = estado.Listar();
            //HASTA ACA LO QUE DEBERIA HACER ES ENCONTRAR EL PRODUCTO QUE QUIERO DAR DE BAJA
            Estado estado1 = listaOriginal.Find(x => x.Id == idAux);



            estado.DarBajaLogicaEstado(estado1);
            return(RedirectToAction("ABMEstados"));
        }
Exemplo n.º 12
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                EstadoNegocio institucionEstado = new EstadoNegocio();
                Estado        objEstado         = new Estado();
                objEstado.idEstado = Convert.ToInt32(lblID.Text);
                objEstado.Nombre   = txtcNombre.Text;


                institucionEstado.eliminaEstado(objEstado);

                Response.Redirect("WebEstado.aspx");
            }
        }
Exemplo n.º 13
0
        public ActionResult FormAltaEstados(Estado estado)
        {
            EstadoNegocio estadoNegocio = new EstadoNegocio();

            if (estado.Id > 0)
            {
                estadoNegocio.Modificar(estado);
            }
            else
            {
                estadoNegocio.Agregar(estado);
            }


            return(RedirectToAction("ABMEstados"));
        }
Exemplo n.º 14
0
        public ActionResult ABMEstados()
        {
            if (Session["TipoUsuario"] as byte? != 1)
            {
                return(RedirectToAction("Catalogo"));
            }

            List <Estado> listaEstados;
            EstadoNegocio estadonegocio = new EstadoNegocio();

            listaEstados = estadonegocio.Listar();

            ViewBag.ListaDeEstados  = listaEstados;
            Session["listaEstados"] = listaEstados;
            return(View());
        }
Exemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            EstadoNegocio estadoNegocio = new EstadoNegocio();

            if (!Page.IsPostBack)
            {
                dropListEstado.DataSource     = estadoNegocio.obtenerEstado();
                dropListEstado.DataValueField = "idEstado";
                dropListEstado.DataTextField  = "Nombre";
                dropListEstado.DataBind();
                GridViewRow datos = (GridViewRow)Session["gvr"];
                lblID.Text      = datos.Cells[0].Text;
                txtcNombre.Text = datos.Cells[2].Text;
                dropListEstado.Items.FindByValue(datos.Cells[1].Text.ToString()).Selected = true;
                txtcNombre.Attributes.Add("placeHolder", "Nombre del Municipio");
            }
        }
Exemplo n.º 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                EstadoNegocio estadoNegocio = new EstadoNegocio();

                try
                {
                    GridViewEstado.DataSource = estadoNegocio.obtenerEstado();
                    GridViewEstado.DataBind();
                }
                catch (Exception ex)
                {
                    throw new Exception("error de la consulta" + ex.Message);
                }
            }
        }
Exemplo n.º 17
0
        public ActionResult FormAltaEstados(int IdAux = 0)
        {
            Estado estado;

            if (Session["TipoUsuario"] as byte? != 1)
            {
                return(RedirectToAction("Catalogo"));
            }
            EstadoNegocio estadoNegocio = new EstadoNegocio();
            List <Estado> ListaEstados;

            ListaEstados = estadoNegocio.Listar();
            estado       = ListaEstados.Find(x => x.Id == IdAux);



            return(View(estado));
        }
Exemplo n.º 18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Pedido         pedido         = new Pedido();
         DetalleNegocio detallenegocio = new DetalleNegocio();
         pedido  = (Pedido)Session[Session.SessionID + "pedido"];
         listado = detallenegocio.listar(pedido);
         Session.Add("listaDetalles", listado);
         dgvDetalles.DataSource = listado;
         dgvDetalles.DataBind();
         EstadoNegocio estadonegocio = new EstadoNegocio();
         seguimiento = estadonegocio.listar(pedido);
         dgvSeguimiento.DataSource = seguimiento;
         dgvSeguimiento.DataBind();
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 19
0
        protected void CargaEstado()
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    EstadoNegocio objEdoBE = new EstadoNegocio();
                    DropListEstado.DataSource     = objEdoBE.obtenerEstado();
                    DropListEstado.DataValueField = "idEstado";
                    DropListEstado.DataTextField  = "Nombre";
                    DropListEstado.DataBind();

                    MunicipioNegocio objMunBE = new MunicipioNegocio();
                    dropListMunicipio.DataSource     = objMunBE.obtenerMunicipio(1);
                    dropListMunicipio.DataValueField = "idMunicipio";
                    dropListMunicipio.DataTextField  = "Nombre";
                    dropListMunicipio.DataBind();

                    InstitucionNegocio objInsBE = new InstitucionNegocio();
                    DropListInst.DataSource     = objInsBE.obtenerInstitucion();
                    DropListInst.DataValueField = "idInstitucion";
                    DropListInst.DataTextField  = "NombreInstitucion";
                    DropListInst.DataBind();
                    // catalogo pendiente de carrera

                    /* CarreraNegocio objCarBE = new CarreraNegocio();
                     * DropListCarrera.DataSource = objCarBE.ConsultaInsenCarrera(Convert.ToInt32(DropListInst.SelectedValue.ToString()));
                     * DropListCarrera.DataValueField = "idCarrera";
                     * DropListCarrera.DataTextField = "Nombre";
                     * DropListCarrera.DataBind(); */
                }
            }
            catch (Exception ex)
            {
                Mensajes.Msjs(this, "Error", "Ocurrió el siguiente detalle: " + ex.Message);
            }
        }
Exemplo n.º 20
0
        protected void grdEstados_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            EstadoNegocio nEstado = new EstadoNegocio();

            grdEstados.DataSource = nEstado.ObtieneEstados(CL_PAIS: vClPais);
        }
        protected void ftGrdCandidatos_ExpressionItemCreated(object sender, RadFilterExpressionItemCreatedEventArgs e)
        {
            RadFilterSingleExpressionItem singleItem = e.Item as RadFilterSingleExpressionItem;

            if (singleItem != null)
            {
                switch (singleItem.FieldName)
                {
                case "CL_SOLICITUD_ESTATUS":
                    RadDropDownList dropDownList = singleItem.InputControl as RadDropDownList;

                    List <E_GENERICA> vLstElementos = new List <E_GENERICA>();

                    vLstElementos.Add(new E_GENERICA {
                        CL_GENERICA = "CREADA", NB_GENERICO = "CREADA"
                    });
                    vLstElementos.Add(new E_GENERICA {
                        CL_GENERICA = "En Proceso", NB_GENERICO = "En Proceso"
                    });

                    dropDownList.DataSource = vLstElementos;
                    dropDownList.DataBind();
                    break;

                case "CL_ESTADO":
                    RadComboBox       dropDownEstado = singleItem.InputControl as RadComboBox;
                    EstadoNegocio     nEstado        = new EstadoNegocio();
                    List <E_GENERICA> vLstEstados    = new List <E_GENERICA>();

                    vLstEstados = nEstado.ObtieneEstados().Select(t => new E_GENERICA {
                        CL_GENERICA = t.CL_ESTADO, NB_GENERICO = t.NB_ESTADO
                    }).ToList();

                    dropDownEstado.Filter     = RadComboBoxFilter.Contains;
                    dropDownEstado.MaxHeight  = Unit.Pixel(350);
                    dropDownEstado.DataSource = vLstEstados;
                    dropDownEstado.DataBind();

                    break;

                case "CL_MUNICIPIO":
                    RadComboBox       dropDownMunicipio = singleItem.InputControl as RadComboBox;
                    MunicipioNegocio  nMunicipio        = new MunicipioNegocio();
                    List <E_GENERICA> vLstMunicipio     = new List <E_GENERICA>();

                    vLstMunicipio = nMunicipio.ObtieneMunicipios().Select(t => new E_GENERICA {
                        CL_GENERICA = t.CL_MUNICIPIO, NB_GENERICO = t.DS_FILTRO
                    }).ToList();

                    dropDownMunicipio.Filter     = RadComboBoxFilter.Contains;
                    dropDownMunicipio.MaxHeight  = Unit.Pixel(350);
                    dropDownMunicipio.DataSource = vLstMunicipio;
                    dropDownMunicipio.DataBind();

                    break;

                case "FE_NACIMIENTO":

                    RadDatePicker dtpNacimiento = singleItem.InputControl as RadDatePicker;

                    dtpNacimiento.DateInput.DateFormat        = "dd/MM/yyyy";
                    dtpNacimiento.DateInput.DisplayDateFormat = "dd/MM/yyyy";

                    break;

                //case "CL_COLONIA":
                //    RadComboBox dropDownColonia = singleItem.InputControl as RadComboBox;
                //    ColoniaNegocio nColonia = new ColoniaNegocio();
                //    List<E_GENERICA> vLstColonias = new List<E_GENERICA>();
                //    vLstColonias = nColonia.ObtieneColonias().Select(t => new E_GENERICA { CL_GENERICA = t.CL_COLONIA, NB_GENERICO = t.DS_FILTRO }).ToList();
                //    dropDownColonia.Filter = RadComboBoxFilter.Contains;
                //    //dropDownMunicipio.DropDownWidth = Unit.Pixel(250);
                //    dropDownColonia.MaxHeight = Unit.Pixel(350);
                //    dropDownColonia.DataSource = vLstColonias;
                //    dropDownColonia.DataBind();
                //    break;


                default:
                    break;
                }
            }
        }