Ejemplo n.º 1
0
        private void CargarGrillaTelefonos()
        {
            ListaDeTelefonosDTO.Clear();

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

            List <TelefonoEntidad> TelefonosDelUsuario = new List <TelefonoEntidad>();

            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()
                {
                    Tipo     = UsuarioBLL.ObtenerTipodeTelefono(tel.miTipoTel.IdTipoTel),
                    Telefono = tel.NroTelefono,
                    CodArea  = tel.CodArea
                };

                ListaDeTelefonosDTO.Add(TipodeTelefono);
                //tipo = false;
            }

            grillatelefonos.DataSource = ListaDeTelefonosDTO;

            grillatelefonos.DataBind();
        }
Ejemplo n.º 2
0
 public bool deleteTelefono()
 {
     //valido que el telefono no sea NULL o numeros vacios
     if (this.Telefonoid != -1 && this.numeroCasa != null && this.numeroCelular != null &&
         (this.numeroCasa != "" || this.numeroCelular != ""))
     {
         TelefonoDTO teldto = new TelefonoDTO();
         teldto = teldto.GetTelefono(this.Telefonoid);
         return(teldto.DeshabilitarTelefono(false));
     }
     return(false);
 }
Ejemplo n.º 3
0
 public int addTelefono()
 {
     //valido que el telefono no sea NULL o numeros vacios
     if (this.Telefonoid != -1 && this.numeroCasa != null && this.numeroCelular != null &&
         (this.numeroCasa != "" || this.numeroCelular != ""))
     {
         TelefonoDTO teldto = new TelefonoDTO();
         teldto.numeroCasa    = this.numeroCasa;
         teldto.numeroCelular = this.numeroCelular;
         return(teldto.addTelefono());
     }
     return(Telefonoid);
 }
Ejemplo n.º 4
0
 public bool ModifyTelefono()
 {
     //valido que el telefono no sea NULL o numeros vacios
     if (this.Telefonoid != -1 && this.numeroCasa != null && this.numeroCelular != null &&
         (this.numeroCasa != "" || this.numeroCelular != ""))
     {
         TelefonoDTO teldto = new TelefonoDTO();
         teldto.Telefonoid    = this.Telefonoid;
         teldto.numeroCasa    = this.numeroCasa;
         teldto.numeroCelular = this.numeroCelular;
         return(teldto.ModifyTelefono());
     }
     return(false);
 }
Ejemplo n.º 5
0
        //Devuelve telefono por id caso de no encontrarlo devuelve id en -1 y numeros en null
        public void GetTelefonobyID(int telefonoid)
        {
            TelefonoDTO teldto = new TelefonoDTO();

            teldto = teldto.GetTelefono(telefonoid);
            if (teldto != null)
            {
                this.Telefonoid    = teldto.Telefonoid;
                this.numeroCasa    = teldto.numeroCasa;
                this.numeroCelular = teldto.numeroCelular;
            }
            else
            {
                this.Telefonoid    = -1;
                this.numeroCasa    = null;
                this.numeroCelular = null;
            }
        }
Ejemplo n.º 6
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();
                }
            }
        }