예제 #1
0
        protected void DGVSucursales_SelectedIndexChanged(object sender, EventArgs e)
        {
            Guid valor = Guid.Parse(DGVSucursales.SelectedDataKey.Value.ToString());

            MVSucursales.RecuperaCategoria(valor.ToString());
            MVSucursales.ObtenerSucursal(valor.ToString());
            txtUidSucursal.Text = MVSucursales.ID.ToString();
            lblSucursal.Text    = MVSucursales.IDENTIFICADOR;

            if (txtUidSucursal.Text != string.Empty && lblSeleccionSucursal.Visible == false)
            {
                lblSeleccionSucursal.Visible = true;
            }

            if (lblSeleccionOferta.Visible == true)
            {
                lblSeleccionOferta.Visible = false;
                lblOferta.Text             = string.Empty;
                txtUidOferta.Text          = string.Empty;
            }

            if (lblSeleccionSeccion.Visible == true)
            {
                lblSeleccionSeccion.Visible = false;
                lblSeccion.Text             = string.Empty;
                txtUidSeccion.Text          = string.Empty;
            }

            //Muestra los productos asociados a la subcategoria dependiendo la subcategoria a la que esta pertenezca
            MVProducto.BuscarProductos(valor);
            DLProductos.DataSource = MVProducto.ListaDeProductos;
            DLProductos.DataBind();

            DLProductoSeleccionado.DataSource = null;
            DLProductoSeleccionado.DataBind();


            MVOferta.Buscar(UIDSUCURSAL: valor);
            CargaGrid("Oferta");

            DGVSeccion.DataSource = null;
            DGVSeccion.DataBind();
        }
예제 #2
0
        // GET: api/Profile/5
        public ResponseHelper GetBuscarOferta(string UIDOFERTA = "", string UIDSUCURSAL = "", string NOMBRE = "", string ESTATUS = "", string UidEmpresa = "")
        {
            MVOferta = new VMOferta();
            if (string.IsNullOrEmpty(UIDOFERTA))
            {
                UIDOFERTA = Guid.Empty.ToString();
            }
            if (string.IsNullOrEmpty(UIDSUCURSAL))
            {
                UIDSUCURSAL = Guid.Empty.ToString();
            }
            if (string.IsNullOrEmpty(UidEmpresa))
            {
                UidEmpresa = Guid.Empty.ToString();
            }
            MVOferta.Buscar(new Guid(UIDOFERTA), new Guid(UIDSUCURSAL), NOMBRE, ESTATUS, new Guid(UidEmpresa));

            Respuesta         = new ResponseHelper();
            Respuesta.Data    = MVOferta;
            Respuesta.Status  = true;
            Respuesta.Message = "Informacion recibida satisfactoriamente";
            return(Respuesta);
        }
예제 #3
0
        protected void lvSucursalesEmpresa_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            ListView dl = sender as ListView;

            if (e == null || e.Item == null)
            {
                Trace.Write("dl_ItemCommand", "EventArgs.Item is null");
                throw new Exception("dl_ItemCommand: EventArgs.Item is null");
            }

            int selIdx = dl.SelectedIndex;

            Trace.Write("dl_ItemCommand", String.Format("{0}: {1}",
                                                        e.CommandName.ToLower(), e.Item.DataItemIndex));

            switch (e.CommandName.ToLower())
            {
            case "select":
                HiddenField uidSeccion   = e.Item.FindControl("lblUidSeccion") as HiddenField;
                LinkButton  btnSeleccion = e.Item.FindControl("btnSeleccion") as LinkButton;
                //selIdx = e.Item.DataItemIndex;
                //dl.SelectedIndex = selIdx;

                DropDownList ddlOfertas                       = PanelCentral.Controls[0].Controls[27].FindControl("ddlOfertas") as DropDownList;
                Label        lblNombreSucursal                = PanelCentral.Controls[0].Controls[27].FindControl("lblNombreSucursal") as Label;
                Label        lblHorarioDeServicio             = PanelCentral.Controls[0].Controls[27].FindControl("lblHorarioDeServicio") as Label;
                Label        lblDireccionSucursalSeleccionada = PanelCentral.Controls[0].Controls[27].FindControl("lblDireccionSucursalSeleccionada") as Label;
                DataList     DLProductosSucursal              = PanelCentral.Controls[0].Controls[27].FindControl("DLProductosSucursal") as DataList;
                Menu         MnSecciones                      = PanelCentral.Controls[0].Controls[27].FindControl("MnSecciones") as Menu;
                HiddenField  hfSucursalSeleccionada           = PanelCentral.Controls[0].Controls[27].FindControl("hfSucursalSeleccionada") as HiddenField;
                var          registro = MVSucursales.LISTADESUCURSALES[e.Item.DataItemIndex];

                lblNombreSucursal.Text    = registro.IDENTIFICADOR;
                lblHorarioDeServicio.Text = "De " + registro.HORAAPARTURA + " A " + registro.HORACIERRE;

                MVDireccion.ObtenerDireccionSucursal(registro.ID.ToString());
                lblDireccionSucursalSeleccionada.Text = "Ubicación: " + MVDireccion.ObtenerNombreDeLaColonia(MVDireccion.COLONIA) + ", " + MVDireccion.CALLE0;

                MVOferta.Buscar(UIDSUCURSAL: registro.ID);
                ddlOfertas.DataSource     = MVOferta.ListaDeOfertas;
                ddlOfertas.DataTextField  = "STRNOMBRE";
                ddlOfertas.DataValueField = "UID";
                ddlOfertas.DataBind();

                hfSucursalSeleccionada.Value = registro.ID.ToString();
                MVSeccion.Buscar(UIDOFERTA: MVOferta.ListaDeOfertas[0].UID);
                MnSecciones.Items.Clear();
                MenuItem elemento = new MenuItem();
                foreach (var item in MVSeccion.ListaDeSeccion)
                {
                    elemento       = new MenuItem();
                    elemento.Text  = item.StrNombre;
                    elemento.Value = item.UID.ToString();
                    MnSecciones.Items.Add(elemento);
                }
                MnSecciones.Items[0].Selected = true;

                MVProducto.BuscarProductosSeccion(new Guid(MnSecciones.Items[0].Value));

                DLProductosSucursal.DataSource = MVProducto.ListaDeProductos;
                DLProductosSucursal.DataBind();
                break;

            default:
                break;
            }
            if (selIdx != dl.SelectedIndex)
            {
                dl.SelectedIndex = selIdx;
            }
            dl.DataSource = MVSucursales.LISTADESUCURSALES;
            dl.DataBind();
        }