Ejemplo n.º 1
0
 public Tarjetas()
 {
     idioma      = new LenguajeEntidad();
     cotizacion  = new MonedaEmpresaEntidad();
     moneda      = new MonedaEntidad();
     _coreMoneda = new MonedaCore();
 }
 public PedidosConfirmacion()
 {
     idioma      = new LenguajeEntidad();
     cotizacion  = new MonedaEmpresaEntidad();
     moneda      = new MonedaEntidad();
     _coreMoneda = new MonedaCore();
 }
Ejemplo n.º 3
0
 public ListaDeDeseos()
 {
     idioma      = new LenguajeEntidad();
     cotizacion  = new MonedaEmpresaEntidad();
     _coreMoneda = new MonedaCore();
     moneda      = new MonedaEntidad();
 }
Ejemplo n.º 4
0
        protected void grillaCotizacion_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            MonedaEmpresaEntidad moneda = new MonedaEmpresaEntidad();
            GridViewRow          row    = grillaCotizacion.Rows[e.RowIndex];
            //var txt = (TextBox)row.Cells[1].FindControl("ID");
            //txt.ReadOnly = false;

            var IdMoneda   = Int32.Parse(e.Keys["IdMoneda"].ToString());
            var ISOCODE    = ((TextBox)row.Cells[2].Controls[0]).Text;
            var cotizacion = ((TextBox)row.Cells[3].Controls[0]).Text;
            // var fechaCotizacion = ((TextBox)row.Cells[4].Controls[0]).Text;
            var simbolo = ((TextBox)row.Cells[4].Controls[0]).Text;

            Regex reg = new Regex("[0-9]"); //Expresión que solo acepta números.

            if (!string.IsNullOrWhiteSpace(ISOCODE) && !string.IsNullOrWhiteSpace(cotizacion) && !string.IsNullOrWhiteSpace(simbolo) && !reg.IsMatch(ISOCODE) && !reg.IsMatch(simbolo) && reg.IsMatch(cotizacion))
            {
                moneda.IdMoneda   = Convert.ToInt32(IdMoneda);
                moneda.Cotizacion = Convert.ToDecimal(cotizacion);
                _managerMoneda.MonedaEmpresaUpdate(moneda);

                //////Reset the edit index.
                grillaCotizacion.EditIndex = -1;

                ////////Bind data to the GridView control.
                grillaCotizacion.DataBind();

                Response.Redirect(Request.RawUrl);
            }
        }
Ejemplo n.º 5
0
 public QuienesSomos()
 {
     idioma      = new LenguajeEntidad();
     cotizacion  = new MonedaEmpresaEntidad();
     moneda      = new MonedaEntidad();
     _coreMoneda = new MonedaCore();
 }
Ejemplo n.º 6
0
 public UltimosPedidos()
 {
     idioma      = new LenguajeEntidad();
     cotizacion  = new MonedaEmpresaEntidad();
     moneda      = new MonedaEntidad();
     _coreMoneda = new MonedaCore();
 }
Ejemplo n.º 7
0
 public MonedaCore()
 {
     this._DALMonedaEmpresa = new MonedaEmpresaDAL();
     this._DALMoneda        = new MonedaDAL();
     this._moneda           = new MonedaEntidad();
     this._monedaEmpresa    = new MonedaEmpresaEntidad();
 }
Ejemplo n.º 8
0
 public RegistroCliente()
 {
     idioma      = new LenguajeEntidad();
     cotizacion  = new MonedaEmpresaEntidad();
     moneda      = new MonedaEntidad();
     _coreMoneda = new MonedaCore();
 }
Ejemplo n.º 9
0
        public static string AgregarItem(string id)
        {
            var Current          = HttpContext.Current;
            var manager          = new ProductoCore();
            var cotizacionStatic = new MonedaEmpresaEntidad();

            cotizacionStatic = (MonedaEmpresaEntidad)Current.Session["Cotizacion"];
            producto         = manager.Find(Int32.Parse(id), cotizacionStatic.IdMoneda);

            var list = (List <ProductoEntidad>)Current.Session["Productos"];

            if (list == null || !list.Any())
            {
                Current.Session["Productos"] = new List <ProductoEntidad>();
                ((List <ProductoEntidad>)Current.Session["Productos"]).Add(producto);
            }
            else
            {
                if (!list.Where(x => x.IdProducto == producto.IdProducto).Any())
                {
                    ((List <ProductoEntidad>)Current.Session["Productos"]).Add(producto);
                }
            }
            return(producto.DescripProducto);
        }
Ejemplo n.º 10
0
 public void ProductoCORE()
 {
     _monedaAnterior = new MonedaEmpresaEntidad();
     _monedaActual   = new MonedaEmpresaEntidad();
     _coreMoneda     = new MonedaCore();
     _productoDal    = new ProductoDAL();
 }
Ejemplo n.º 11
0
 public Catalogo()
 {
     _manager    = new ProductoCore();
     moneda      = new MonedaEntidad();
     _coremoneda = new MonedaCore();
     cotizacion  = new MonedaEmpresaEntidad();
 }
Ejemplo n.º 12
0
        private void RedondearPrecioUnitario()
        {
            cotizacion = _coreMoneda.Select(cotizacion.IdMoneda);
            var r       = (String)Session["cotizacionAnterior"];
            var Current = HttpContext.Current;

            productos = (List <ProductoEntidad>)Current.Session["Productos"];
            var productosRetornar = new List <ProductoEntidad>();

            foreach (var item in productos)
            {
                productosRetornar.Add(_coreProducto.Find(item.IdProducto, cotizacion.IdMoneda));
            }

            productos = productosRetornar;
            //if (cotizacion.Cotizacion > 1 && Convert.ToDecimal(r)!= cotizacion.Cotizacion )
            //{
            //    productos = (List<ProductoEntidad>)Current.Session["Productos"];
            productos.ForEach(x => x.PrecioUnitario = Decimal.Round(x.PrecioUnitario, 2));
            //    Session["cotizacionAnterior"] = cotizacion.Cotizacion.ToString();

            //}
            //else
            //{
            //    productos = (List<ProductoEntidad>)Current.Session["Productos"];

            //    if(r != "")
            //    { productos.ForEach(x => x.PrecioUnitario = decimal.Round(x.PrecioUnitario * Convert.ToDecimal(r), 2)); }
            //    else
            //    {
            //        productos.ForEach(x => x.PrecioUnitario = decimal.Round(x.PrecioUnitario, 2));
            //    }

            //}
        }
Ejemplo n.º 13
0
 public Contacto()
 {
     idioma      = new LenguajeEntidad();
     cotizacion  = new MonedaEmpresaEntidad();
     moneda      = new MonedaEntidad();
     _coreMoneda = new MonedaCore();
 }
Ejemplo n.º 14
0
 public DatosPersonales()
 {
     idioma      = new LenguajeEntidad();
     cotizacion  = new MonedaEmpresaEntidad();
     moneda      = new MonedaEntidad();
     _coreMoneda = new MonedaCore();
 }
Ejemplo n.º 15
0
        ////Para mantener la sesión activa
        //[WebMethod(EnableSession = true)]
        //public static void MantenerSesion()
        //{

        //}

        protected void Page_Load(object sender, EventArgs e)
        {
            idioma = new LenguajeEntidad();

            EmpresaCore EmpresaBLL = new EmpresaCore();

            if (!IsPostBack)
            {
                idioma = (LenguajeEntidad)Session["Idioma"];

                if (idioma == null)
                {
                    idioma = new LenguajeEntidad();
                    idioma.DescripcionLenguaje = "es";
                    Session["Idioma"]          = idioma;
                }
                cotizacion = new MonedaEmpresaEntidad();
                cotizacion = (MonedaEmpresaEntidad)Session["Cotizacion"];
                Session.Add("cotizacionAnterior", "");
            }
            else
            {
                cotizacion.IdMoneda        = Convert.ToInt16(Master.obtenerValorDropDown());
                Session["Cotizacion"]      = cotizacion;
                idioma.DescripcionLenguaje = Master.obtenerIdiomaCombo();
                Session["Idioma"]          = idioma;
            }
            if (cotizacion != null)
            {
                moneda = _coreMoneda.selectMoneda(cotizacion.IdMoneda);
            }
            DropDownList lblIdioma = FindControlFromMaster <DropDownList>("ddlLanguages");

            if (lblIdioma != null)
            {
                lblIdioma.SelectedValue = idioma.DescripcionLenguaje;
            }
            DropDownList lblStatus = FindControlFromMaster <DropDownList>("MonedaDRW");

            if (lblStatus != null)
            {
                if (cotizacion != null)
                {
                    lblStatus.SelectedValue = cotizacion.IdMoneda.ToString();
                }
            }

            nombreempresa.InnerHtml = EmpresaBLL.EmpresaSelectByCuit(ConfigSection.Default.Site.Cuit).NombreEmpresa;

            quienessomos.InnerHtml = EmpresaBLL.SeleccionarContenidoEmpresa(ConfigSection.Default.Site.Cuit, "QuienesSomos", 1).Valor;

            mision.InnerHtml = EmpresaBLL.SeleccionarContenidoEmpresa(ConfigSection.Default.Site.Cuit, "Mision", 1).Valor;

            vision.InnerHtml = EmpresaBLL.SeleccionarContenidoEmpresa(ConfigSection.Default.Site.Cuit, "Vision", 1).Valor;

            TelEmpresa.InnerHtml = EmpresaBLL.SeleccionarContenidoEmpresa(ConfigSection.Default.Site.Cuit, "TelEmpresa", 1).Valor;

            MailEmpresa.InnerHtml = EmpresaBLL.SeleccionarContenidoEmpresa(ConfigSection.Default.Site.Cuit, "MailEmpresa", 1).Valor;
        }
Ejemplo n.º 16
0
 public PedidosDireccion()
 {
     idioma          = new LenguajeEntidad();
     _usuarioManager = new UsuarioCore();
     cotizacion      = new MonedaEmpresaEntidad();
     moneda          = new MonedaEntidad();
     _coreMoneda     = new MonedaCore();
 }
Ejemplo n.º 17
0
 public Producto()
 {
     cotizacion  = new MonedaEmpresaEntidad();
     moneda      = new MonedaEntidad();
     _coreMoneda = new MonedaCore();
     _manager    = new ProductoCore();
     idioma      = new LenguajeEntidad();
 }
Ejemplo n.º 18
0
 public PedidosEnvio()
 {
     idioma        = new LenguajeEntidad();
     _sucursalCore = new SucursalCore();
     cotizacion    = new MonedaEmpresaEntidad();
     moneda        = new MonedaEntidad();
     _coreMoneda   = new MonedaCore();
 }
Ejemplo n.º 19
0
        public void cambiarSeleccion(object sender, EventArgs e)
        {
            var valor    = monedaDRW.SelectedItem.Text;
            var IdMoneda = monedaDRW.SelectedValue;

            Session["Cotizacion"] = devolverCotizacion(Convert.ToInt32(IdMoneda));
            cotizacion            = (MonedaEmpresaEntidad)Session["Cotizacion"];
        }
Ejemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            idioma = new LenguajeEntidad();

            usuarioentidad = (UsuarioEntidad)Session["Usuario"];

            if (usuarioentidad == null)
            {
                Response.Redirect("/Areas/Public/Forms/Home.aspx");
            }
            if (!IsPostBack)
            {
                idioma = (LenguajeEntidad)Session["Idioma"];

                if (idioma == null)
                {
                    idioma = new LenguajeEntidad();
                    idioma.DescripcionLenguaje = "es";
                    Session["Idioma"]          = idioma;
                }
                cotizacion = new MonedaEmpresaEntidad();
                cotizacion = (MonedaEmpresaEntidad)Session["Cotizacion"];
                Session.Add("cotizacionAnterior", "");
            }
            else
            {
                cotizacion.IdMoneda        = Convert.ToInt16(Master.obtenerValorDropDown());
                Session["Cotizacion"]      = cotizacion;
                idioma.DescripcionLenguaje = Master.obtenerIdiomaCombo();
                Session["Idioma"]          = idioma;
            }
            if (cotizacion != null)
            {
                moneda = _coreMoneda.selectMoneda(cotizacion.IdMoneda);
            }
            DropDownList lblIdioma = FindControlFromMaster <DropDownList>("ddlLanguages");

            if (lblIdioma != null)
            {
                lblIdioma.SelectedValue = idioma.DescripcionLenguaje;
            }
            DropDownList lblStatus = FindControlFromMaster <DropDownList>("MonedaDRW");

            if (lblStatus != null)
            {
                if (cotizacion != null)
                {
                    lblStatus.SelectedValue = cotizacion.IdMoneda.ToString();
                }
            }

            CargarGrillaTarjetas();

            if (!IsPostBack)
            {
                CargarDropdownTipoTarjeta();
            }
        }
Ejemplo n.º 21
0
 public Pedidos()
 {
     idioma        = new LenguajeEntidad();
     cotizacion    = new MonedaEmpresaEntidad();
     moneda        = new MonedaEntidad();
     _coreMoneda   = new MonedaCore();
     _coreProducto = new ProductoCore();
     _coreStock    = new StockCore();
 }
Ejemplo n.º 22
0
        public static List <String> ObtenerProductos()
        {
            var core = new ProductoCore();
            // var usuarioentidad = (UsuarioEntidad)HttpContext.Current.Session["Usuario"];
            var cotizacion = new MonedaEmpresaEntidad();

            cotizacion = (MonedaEmpresaEntidad)HttpContext.Current.Session["Cotizacion"];
            var cot2             = Convert.ToInt32(cotizacion.IdMoneda);
            var productosEmpresa = core.FindAllByCUIT(cot2).Where(o => o.FecBaja == null).ToList();

            return(productosEmpresa.Select(x => x.DescripProducto).ToList());
        }
        /// <summary>
        /// Saves a record to the MonedaEmpresa table.
        /// </summary>
        public void Insert(MonedaEmpresaEntidad monedaEmpresa)
        {
            ValidationUtility.ValidateArgument("monedaEmpresa", monedaEmpresa);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@IdMoneda", monedaEmpresa.IdMoneda),
                new SqlParameter("@CUITEmpresa", monedaEmpresa.CUITEmpresa)
            };

            SqlClientUtility.ExecuteNonQuery(SqlClientUtility.connectionStringName, CommandType.StoredProcedure, "MonedaEmpresaInsert", parameters);
        }
Ejemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var logueado = (UsuarioEntidad)Current.Session["Usuario"];

            if (logueado != null)
            {
                if (usuario.IdUsuarioTipo == 2)
                {
                    divLinkIntranet.Visible = true;
                }
                liIngresar.Visible  = false;
                LiDeseos.Visible    = true;
                ComprasDrop.Visible = true;
                SetUsuarioLogueado(logueado.Nombre + " " + logueado.Apellido);

                AuxDeseos = (List <ProductoEntidad>)Current.Session["ListaDeseos"];


                if (AuxDeseos == null || !AuxDeseos.Any())
                {
                    CargarListaDeseosEnSession();
                }
            }
            else
            {
                LiDeseos.Visible    = false;
                ComprasDrop.Visible = false;
                Response.Redirect("/Areas/Public/Forms/Home.aspx");
            }
            //AGREGADOS PARA MONEDA/////
            cotizacion = (MonedaEmpresaEntidad)Current.Session["Cotizacion"];
            if (!this.IsPostBack)
            {
                if (ddlLanguages.Items.FindByValue(CultureInfo.CurrentCulture.Name) != null)
                {
                    ddlLanguages.Items.FindByValue(CultureInfo.CurrentCulture.Name).Selected = true;
                }
                if (idioma == null)
                {
                    Session["Idioma"] = obtenerIdiomaCombo();
                }
                if (cotizacion == null)
                {
                    Session["Cotizacion"] = devolverCotizacion(1);
                }
                cargarMonedas();
            }
        }
Ejemplo n.º 25
0
        ////Para mantener la sesión activa
        //[WebMethod(EnableSession = true)]
        //public static void MantenerSesion()
        //{

        //}

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                idioma = (LenguajeEntidad)Session["Idioma"];
                cargarFiscal();
                cargarProvincias();
                cargarLocalidades();


                if (idioma == null)
                {
                    idioma = new LenguajeEntidad();
                    idioma.DescripcionLenguaje = "es";
                    Session["Idioma"]          = idioma;
                }
                cotizacion = new MonedaEmpresaEntidad();
                cotizacion = (MonedaEmpresaEntidad)Session["Cotizacion"];
                Session.Add("cotizacionAnterior", "");
            }
            else
            {
                cotizacion.IdMoneda        = Convert.ToInt16(Master.obtenerValorDropDown());
                Session["Cotizacion"]      = cotizacion;
                idioma.DescripcionLenguaje = Master.obtenerIdiomaCombo();
            }
            if (cotizacion != null)
            {
                moneda = _coreMoneda.selectMoneda(cotizacion.IdMoneda);
            }
            DropDownList lblIdioma = FindControlFromMaster <DropDownList>("ddlLanguages");

            if (lblIdioma != null)
            {
                lblIdioma.SelectedValue = idioma.DescripcionLenguaje;
            }
            DropDownList lblStatus = FindControlFromMaster <DropDownList>("MonedaDRW");

            if (lblStatus != null)
            {
                if (cotizacion != null)
                {
                    lblStatus.SelectedValue = cotizacion.IdMoneda.ToString();
                }
            }
        }
Ejemplo n.º 26
0
        public MonedaEmpresaEntidad Select(int idMoneda, string CUIT)
        {
            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@IdMoneda", idMoneda),
                new SqlParameter("@CUIT", CUIT)
            };

            using (DataTable dt = SqlClientUtility.ExecuteDataTable(SqlClientUtility.connectionStringName, CommandType.StoredProcedure, "MonedaEmpresaSelect", parameters))
            {
                MonedaEmpresaEntidad MonedaEntidad = new MonedaEmpresaEntidad();

                MonedaEntidad = Mapeador.MapearFirst <MonedaEmpresaEntidad>(dt);

                return(MonedaEntidad);
            }
        }
Ejemplo n.º 27
0
        //protected void y()
        //{
        //    listaMonedas = _managerMoneda.FinAllMonedasByEmpresa();
        //    //grillaMoneda.DataSource = listaMonedas;
        //    //grillaMoneda.AutoGenerateColumns = false;
        //    //grillaMoneda.DataBind();
        //}


        protected List <CotizacionDTO> CargarCotizaciones()
        {
            // listaMonedas = _managerMoneda.FinAllMonedasByEmpresa();
            listaCotizacion.Clear();
            foreach (MonedaEntidad unaMoneda in listaMonedas)
            {
                MonedaEmpresaEntidad monedaDeEmpresa = _managerMoneda.Select(unaMoneda.IdMoneda);
                unaCotizacion               = new CotizacionDTO();
                unaCotizacion.Cotizacion    = monedaDeEmpresa.Cotizacion;
                unaCotizacion.Fecha         = monedaDeEmpresa.Fecha;
                unaCotizacion.Nombre        = unaMoneda.Nombre;
                unaCotizacion.SimboloMoneda = unaMoneda.SimboloMoneda;
                unaCotizacion.Url           = unaMoneda.Url;
                unaCotizacion.IdMoneda      = monedaDeEmpresa.IdMoneda;

                //  listaMonedasEmpresa.Add(monedaDeEmpresa);
                listaCotizacion.Add(unaCotizacion);
            }
            return(listaCotizacion);
        }
Ejemplo n.º 28
0
        public static void AgregarDeseo(string idProducto)
        {
            var Current        = HttpContext.Current;
            var logueadoStatic = (UsuarioEntidad)Current.Session["Usuario"];
            List <ListaDeseoEntidad> listaDeseosSesion  = new List <ListaDeseoEntidad>();
            List <ProductoEntidad>   unaListaProductos  = new List <ProductoEntidad>();
            ListaDeseosCore          unaListaDeseosCore = new ListaDeseosCore();
            ListaDeseoEntidad        unaListaDeseo      = new ListaDeseoEntidad();
            ProductoCore             unProductoCore     = new ProductoCore();

            unaListaProductos = (List <ProductoEntidad>)Current.Session["ListaDeseos"];

            unaListaDeseo.CUIT          = logueadoStatic.CUIT;
            unaListaDeseo.NombreUsuario = logueadoStatic.NombreUsuario;
            unaListaDeseo.IdProducto    = Int32.Parse(idProducto);
            var cotizacion = new MonedaEmpresaEntidad();

            cotizacion = (MonedaEmpresaEntidad)Current.Session["Productos"];
            //Guardar en BD el nuevo deseo
            if (unaListaDeseosCore.ListaDeseosInsert(unaListaDeseo) > 0)
            {
                //Agregar el deseo a la sesión actual
                //List<ListaDeseoEntidad> unasListaDeseoEntidad = new List<ListaDeseoEntidad>();
                //unasListaDeseoEntidad = unaListaDeseosCore.ListaDeseosSelectAllByCUIT_NombreUsuario(logueadoStatic.NombreUsuario);

                //foreach (var item in unasListaDeseoEntidad)
                //{
                ProductoEntidad unProductoEntidad = new ProductoEntidad();
                unProductoEntidad = unProductoCore.Find(unaListaDeseo.IdProducto, 1);
                unaListaProductos.Add(unProductoEntidad);
                //}
                //listaDeseosSesion.Add(unaListaDeseo);
                Current.Session["ListaDeseos"] = unaListaProductos;
                //ActualizarDeseos();
            }
        }
Ejemplo n.º 29
0
        ////Para mantener la sesión activa
        //[WebMethod(EnableSession = true)]
        //public static void MantenerSesion()
        //{

        //}

        protected void Page_Load(object sender, EventArgs e)
        {
            idioma = new LenguajeEntidad();

            if (!IsPostBack)
            {
                cargarFiltros();

                idioma     = (LenguajeEntidad)Session["Idioma"];
                cotizacion = (MonedaEmpresaEntidad)Session["Cotizacion"];

                if (cotizacion == null)
                {
                    cotizacion            = new MonedaEmpresaEntidad();
                    cotizacion.IdMoneda   = 1;
                    Session["Cotizacion"] = cotizacion;
                }

                if (idioma == null)
                {
                    idioma = new LenguajeEntidad();
                    idioma.DescripcionLenguaje = "es";
                    Session["Idioma"]          = idioma;
                }
                if (cotizacion != null)
                {
                    moneda = _coremoneda.selectMoneda(cotizacion.IdMoneda);
                }

                stringBusqueda  = Page.Request.QueryString["search"];
                stringCategoria = Page.Request.QueryString["Categoria"];
                Session.Add("ProductosEnSesion", unosProductos);



                if (!string.IsNullOrEmpty(stringBusqueda))
                {
                    if (stringBusqueda == "*")
                    {
                        //unosProductos = _manager.ProductoSelectMasVendidosByCUIT(TFI.CORE.Helpers.ConfigSection.Default.Site.Cuit);
                        unosProductos       = _manager.FindAllByCUIT(cotizacion.IdMoneda).Where(o => o.FecBaja == null).ToList();
                        catalogo.DataSource = unosProductos;
                        catalogo.DataBind();
                        Session["ProductosEnSesion"] = unosProductos;
                    }
                    else
                    {
                        var cotizacionStatic = new MonedaEmpresaEntidad();
                        cotizacionStatic = (MonedaEmpresaEntidad)Current.Session["Cotizacion"];
                        //                      unosProductos = _manager.FindAllByDescripProducto(stringBusqueda);
                        unosProductos       = _manager.FindAllByDescripProducto(stringBusqueda, cotizacionStatic.IdMoneda).Where(o => o.FecBaja == null).ToList();
                        catalogo.DataSource = unosProductos;
                        catalogo.DataBind();
                        Session["ProductosEnSesion"] = unosProductos;
                    }
                }


                if (!string.IsNullOrEmpty(stringCategoria))
                {
                    if (Int32.Parse(stringCategoria) > 0 && Int32.Parse(stringCategoria) < 500)
                    {
                        unosProductos       = _manager.ProductoSelectByCategoria(Int32.Parse(stringCategoria), cotizacion.IdMoneda).Where(o => o.FecBaja == null).ToList();
                        catalogo.DataSource = unosProductos;
                        catalogo.DataBind();
                        Session["ProductosEnSesion"] = unosProductos;
                    }
                    else
                    {
                        notif.Attributes.Remove("hidden");
                        notif.InnerHtml = string.Format("<span>{0}</span>", "No existe la categoría ingresada");
                    }
                }



                if (!unosProductos.Any())
                {
                    notif.Attributes.Remove("hidden");
                    notif.InnerHtml = string.Format("<span>{0}</span>", "No se encontraron productos, por favor realice otra búsqueda");
                }
            }

            else
            {
                idioma.DescripcionLenguaje = Master.obtenerIdiomaCombo();
                Session["Idioma"]          = idioma;
                cotizacion.IdMoneda        = Convert.ToInt16(Master.obtenerValorDropDown());
                unosProductos         = (List <ProductoEntidad>)Session["ProductosEnSesion"];
                cotizacion            = _coremoneda.Select(cotizacion.IdMoneda);
                Session["Cotizacion"] = cotizacion;
                foreach (var item in unosProductos)
                {
                    var item2 = _manager.Find(item.IdProducto, cotizacion.IdMoneda);
                    //if (cotizacion.Cotizacion >1)
                    //{
                    //    item.PrecioUnitario = item2.PrecioUnitario / cotizacion.Cotizacion;
                    //}
                    //else
                    //{ item.PrecioUnitario = item2.PrecioUnitario * cotizacion.Cotizacion; }
                    item.PrecioUnitario = decimal.Round(item2.PrecioUnitario, 2);
                }
                catalogo.DataSource = unosProductos;
                catalogo.DataBind();
            }
            if (cotizacion != null)
            {
                moneda = _coremoneda.selectMoneda(cotizacion.IdMoneda);
            }
            //CargarCategorias

            unasCategorias           = ManagerCategoria.SeleccionarCategorias();
            rptCategorias.DataSource = unasCategorias;
            rptCategorias.DataBind();
            //seteo el combo de moneda cuando refresco en el elegido sino se pierde
            DropDownList lblStatus = FindControlFromMaster <DropDownList>("MonedaDRW");
            DropDownList lblIdioma = FindControlFromMaster <DropDownList>("ddlLanguages");

            if (lblIdioma != null)
            {
                lblIdioma.SelectedValue = idioma.DescripcionLenguaje;
                //  lblIdioma.Items.FindByValue(CultureInfo.CurrentCulture.Name).Selected = true;
                //Thread.CurrentThread.CurrentCulture = new CultureInfo(idioma.DescripcionLenguaje);
                //Thread.CurrentThread.CurrentUICulture = new CultureInfo(idioma.DescripcionLenguaje);
            }
            if (lblStatus != null)
            {
                if (cotizacion != null)
                {
                    lblStatus.SelectedValue = cotizacion.IdMoneda.ToString();
                }
            }

            var valordropdown = Session["ValorDrop"];

            if (valordropdown != null)
            {
                if (Convert.ToInt32(valordropdown) == 0)
                {
                    catalogo.DataSource = unosProductos.OrderByDescending(x => x.PrecioUnitario);;
                    catalogo.DataBind();
                }
                else if (Convert.ToInt32(valordropdown) == 1)
                {
                    catalogo.DataSource = unosProductos.OrderBy(x => x.PrecioUnitario);;
                    catalogo.DataBind();
                }
                else if (Convert.ToInt32(valordropdown) == 2)
                {
                    catalogo.DataSource = unosProductos.OrderByDescending(x => x.DescripProducto);;
                    catalogo.DataBind();
                }
                else if (Convert.ToInt32(valordropdown) == 3)
                {
                    catalogo.DataSource = unosProductos.OrderBy(x => x.DescripProducto);;
                    catalogo.DataBind();
                }
            }
        }
Ejemplo n.º 30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DireccionesFacturacionDeUsuario.Clear();
            DireccionesEnvioDeUsuario.Clear();
            cargarTipoTel();
            usuarioentidad = (UsuarioEntidad)HttpContext.Current.Session["Usuario"];

            if (usuarioentidad == null)
            {
                Response.Redirect("Home.aspx");
            }

            usuario.Value = usuarioentidad.NombreUsuario;
            clave.Value   = usuarioentidad.Clave;
            clave.Value   = clave.Value.Replace(usuarioentidad.Clave, "*********");

            DatosPersonalesDTO DatosPersonalesDTO = new DatosPersonalesDTO()
            {
                Apellido = usuarioentidad.Apellido,
                Email    = usuarioentidad.Email,
                Nombre   = usuarioentidad.Nombre
            };


            List <DatosPersonalesDTO> ListaDatosPersonalesDTO = new List <DatosPersonalesDTO>();

            ListaDatosPersonalesDTO.Add(DatosPersonalesDTO);
            grilladedatospersonales.DataSource = ListaDatosPersonalesDTO;


            if (!IsPostBack)
            {
                idioma = (LenguajeEntidad)Session["Idioma"];
                if (idioma == null)
                {
                    idioma = new LenguajeEntidad();
                    idioma.DescripcionLenguaje = "es";
                    Session["Idioma"]          = idioma;
                }
                cotizacion = new MonedaEmpresaEntidad();
                cotizacion = (MonedaEmpresaEntidad)Session["Cotizacion"];
                Session.Add("cotizacionAnterior", "");
                grilladedatospersonales.DataBind();
            }
            else
            {
                cotizacion.IdMoneda        = Convert.ToInt16(Master.obtenerValorDropDown());
                Session["Cotizacion"]      = cotizacion;
                idioma.DescripcionLenguaje = Master.obtenerIdiomaCombo();
                Session["Idioma"]          = idioma;
            }
            if (cotizacion != null)
            {
                moneda = _coreMoneda.selectMoneda(cotizacion.IdMoneda);
            }


            TelefonosDelUsuario = UsuarioBLL.SelectTelefonosDeUsuario(usuarioentidad.CUIT, usuarioentidad.NombreUsuario);
            if (TelefonosDelUsuario != null && TelefonosDelUsuario.Count > 0)
            {
                TelefonosDelUsuario = TelefonosDelUsuario.Where(X => X.FecBaja == null).ToList();
            }


            foreach (var tel in TelefonosDelUsuario)
            {
                TelefonoDTO TipodeTelefono = new TelefonoDTO();
                TipodeTelefono.Tipo     = UsuarioBLL.ObtenerTipodeTelefono(tel.miTipoTel.IdTipoTel);
                TipodeTelefono.Telefono = tel.NroTelefono;
                TipodeTelefono.CodArea  = tel.CodArea;
                ListaDeTelefonosDTO.Add(TipodeTelefono);
            }

            grillatelefonos.DataSource = ListaDeTelefonosDTO;

            if (!IsPostBack)
            {
                grillatelefonos.DataBind();
            }

            DireccionesDeUsuario = UsuarioBLL.SelectDireccionesDeUsuarioActuales(usuarioentidad);

            foreach (var item in DireccionesDeUsuario)
            {
                if (item.IdTipoDireccion == 1)
                {
                    DireccionesFacturacionDeUsuario.Add(item);
                }
                else if (item.IdTipoDireccion == 2)
                {
                    DireccionesEnvioDeUsuario.Add(item);
                }
            }

            grilladirecciondefacturacion.DataSource = DireccionesFacturacionDeUsuario;
            if (!IsPostBack)
            {
                grilladirecciondefacturacion.DataBind();
            }

            grilladirecciondeenvio.DataSource = DireccionesEnvioDeUsuario;
            if (!IsPostBack)
            {
                grilladirecciondeenvio.DataBind();
            }

            if (!IsPostBack)
            {
                CargarDropdownProvinciasFact();
                cargarLocalidadesFact();
                CargarDropdownProvinciasEnvio();
                cargarLocalidadesEnvio();
            }

            DropDownList lblIdioma = FindControlFromMaster <DropDownList>("ddlLanguages");

            if (lblIdioma != null)
            {
                lblIdioma.SelectedValue = idioma.DescripcionLenguaje;
            }
            DropDownList lblStatus = FindControlFromMaster <DropDownList>("MonedaDRW");

            if (lblStatus != null)
            {
                if (cotizacion != null)
                {
                    lblStatus.SelectedValue = cotizacion.IdMoneda.ToString();
                }
            }
        }