Ejemplo n.º 1
0
 protected override void AccionLimpiar()
 {
     foreach (Control control in this.groupBox1.Controls)
     {
         if (control.Enabled)
         {
             if (control is TextBox)
             {
                 control.Text = "";
             }
             if (control is NumericUpDown)
             {
                 ((NumericUpDown)control).Value = 0;
             }
             if (control is DateTimePicker)
             {
                 ((DateTimePicker)control).Value = DateManager.Ahora();
             }
             if (control is ComboBox)
             {
                 ((ComboBox)control).SelectedIndex = 0;
             }
             if (control is CheckedListBox)
             {
                 for (int i = 0; i < this.list_Rubros.Items.Count; i++)
                 {
                     list_Rubros.SetItemChecked(i, false);
                 }
             }
         }
     }
 }
 protected override void AccionLimpiar()
 {
     foreach (Control item in this.groupBox1.Controls)
     {
         if (item is TextBox)
         {
             item.Text = "";
         }
         else if (item is NumericUpDown)
         {
             ((NumericUpDown)item).Value = 0;
         }
         else if (item is DateTimePicker)
         {
             ((DateTimePicker)item).Value = DateManager.Ahora();
         }
         else if (item is CheckBox)
         {
             ((CheckBox)item).Checked = false;
         }
         else if (item is CheckedListBox)
         {
             for (int i = 0; i < this.list_Rubros.Items.Count; i++)
             {
                 list_Rubros.SetItemChecked(i, false);
             }
         }
     }
     this.cb_Estado.SelectedIndex      = 0;
     this.cb_Visibilidad.SelectedIndex = 0;
 }
Ejemplo n.º 3
0
 protected override void AccionIniciar()
 {
     this.AgregarValidacion(new ValidadorString(this.tb_Descripcion, 1, 255));
     this.AgregarValidacion(new ValidadorCombobox(this.cb_Visibilidad));
     this.AgregarValidacion(new ValidadorCombobox(this.cb_Estado));
     this.AgregarValidacion(new ValidadorDateTimeUntil(this.dp_Fecha_inicio, DateManager.Ahora()));
 }
Ejemplo n.º 4
0
        static void Main()
        {
            string path     = AppConfigReader.Get("log_path");
            string filename = Path.Combine(path, string.Format("{0}.log", DateTime.Now.ToString("yyyyMMddhhmmss")));

            ContextoActual = new ContextoAplicacion(filename, DateManager.Ahora());

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                ContextoActual.Logger.Iniciar();
                Application.Run(new FrbaCommerce.Inicio());
            }
            catch (Exception ex)
            {
                MessageDialog.MensajeError("Ha ocurrido un error fatal. Revise el archivo de log para obtener más información al respecto.");
                ContextoActual.Logger.Log(ex);
            }
            finally
            {
                ContextoActual.Logger.Finalizar();
            }
        }
Ejemplo n.º 5
0
        private void EscribirLinea(string mensaje)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0} - {1}", DateManager.Format(DateManager.Ahora()), mensaje);
            _stream.WriteLine(sb.ToString());
        }
Ejemplo n.º 6
0
 private void CargarFactura()
 {
     this.tb_Username.Text        = this.factura.vendedor.username;
     this.tb_Total_facturado.Text = "$ " + this.factura.total.ToString();
     this.tb_Fecha.Text           = DateManager.Ahora().ToString();
     this.lbl_Titulo.Text         = this.lbl_Titulo.Text + this.factura.nro_factura.ToString();
     this.CargarItems();
 }
Ejemplo n.º 7
0
 protected override void AccionIniciar()
 {
     this.CargarComboVisibilidad();
     this.CargarComboEstados();
     this.CargarComboTipoPublicacion();
     this.dp_Fecha_de_inicio.Value      = DateManager.Ahora();
     this.dp_Fecha_de_vencimiento.Value = DateManager.Ahora();
     this.btn_Habilitacion.Visible      = false;
 }
Ejemplo n.º 8
0
 private Oferta armarOferta()
 {
     Oferta oferta = new Oferta();
     oferta.publicacion = new Publicacion();
     oferta.publicacion = this.publi;
     oferta.usuario_ofertador = new Usuario();
     oferta.usuario_ofertador = this.usuarioActual;
     oferta.fecha = DateManager.Ahora();
     oferta.monto = this.nud_Ingresar_monto_a_ofertar.Value;
     return oferta;
 }
Ejemplo n.º 9
0
 protected override void AccionLimpiar()
 {
     this.tb_Descripcion.Text           = "";
     this.dp_Fecha_de_inicio.Value      = DateManager.Ahora();
     this.dp_Fecha_de_vencimiento.Value = DateManager.Ahora();
     this.cb_Estado.SelectedIndex       = 0;
     this.cb_Visibilidad.SelectedIndex  = 0;
     this.tb_Rubro.Text     = "";
     this.rubroSeleccionado = null;
     this.cb_Tipo_de_publicacion.SelectedIndex = 0;
     this.Filtrar();
 }
Ejemplo n.º 10
0
        private Preguntas armarPregunta()
        {
            Preguntas preg = new Preguntas();

            preg.id_pregunta    = 0;
            preg.id_publicacion = this.publi.id_publicacion;
            preg.pregunta       = this.tb_Pregunta.Text;
            preg.fecha_pregunta = DateManager.Ahora();
            preg.usuario        = new Usuario();
            preg.usuario        = this.usuarioPreguntador;
            return(preg);
        }
 private void GenerarPublicacion_Load(object sender, EventArgs e)
 {
     this.AgregarValidacion(new ValidadorString(this.tb_Descripcion, 1, 255));
     this.AgregarValidacion(new ValidadorCombobox(this.cb_Visibilidad));
     this.AgregarValidacion(new ValidadorCombobox(this.cb_Estado));
     this.AgregarValidacion(new ValidadorCheckedListBox(this.list_Rubros));
     this.AgregarValidacion(new ValidadorDateTimeUntil(this.dp_Fecha_inicio, DateManager.Ahora()));
     this.CargarCombos();
     this.CargarListaRubros();
     this.CargarNudStock();
     this.tb_Fecha_de_vencimiento.Text = "";
     this.CargarFechaDeVencimiento();
 }
Ejemplo n.º 12
0
        private Compra armarCompra()
        {
            Compra compra = new Compra();

            compra.publicacion       = new Publicacion();
            compra.publicacion       = this.publiCompra;
            compra.usuario_comprador = new Usuario();
            compra.usuario_comprador = this.usuarioActual;
            compra.fecha             = DateManager.Ahora();
            compra.cantidad          = this.nud_Ingresar_cantidad.Value;
            compra.calificacion      = new Calificacion();
            return(compra);
        }
        private ItemPendiente armarItemBonificado(DataGridViewRow row)
        {
            ItemPendiente itemBonificado = new ItemPendiente();

            itemBonificado.cantidad_a_rendir    = 1;
            itemBonificado.Facturar             = true;
            itemBonificado.fecha_inicio         = DateManager.Ahora();
            itemBonificado.id_compra            = 0;
            itemBonificado.id_publicacion       = getIdPublicacion(row);
            itemBonificado.id_visibilidad       = getIdVisibilidad(row);
            itemBonificado.importe_a_rendir     = getImporteARendir(row);
            itemBonificado.resumen              = "Bonificacion por 10 publicaciones. Publicacion bonificada: " + getIdPublicacion(row).ToString() + " - Importe: $ -" + getImporteARendir(row).ToString();
            itemBonificado.tipo_item_a_facturar = BONIFICACION;
            return(itemBonificado);
        }
Ejemplo n.º 14
0
 private void CargarPregunta()
 {
     this.tb_Pregunta.Text          = this.pregunta.pregunta;
     this.tb_Fecha_de_pregunta.Text = this.pregunta.fecha_pregunta.ToShortDateString();
     this.tb_Usuario.Text           = this.pregunta.usuario.username;
     if (this.ModoCrear)
     {
         this.tb_Respuesta.Text          = "";
         this.tb_Fecha_de_respuesta.Text = DateManager.Ahora().ToString();
     }
     else
     {
         this.tb_Respuesta.Text          = this.pregunta.respuesta;
         this.tb_Fecha_de_respuesta.Text = this.pregunta.fecha_respuesta.ToString();
     }
 }
Ejemplo n.º 15
0
 protected override void AccionLimpiar()
 {
     this.tb_Calle.Text              = "";
     this.tb_Altura.Text             = "";
     this.tb_Ciudad.Text             = "";
     this.tb_Codigo_postal.Text      = "";
     this.tb_Contraseña.Text         = "";
     this.tb_Correo_electronico.Text = "";
     this.tb_CUIT.Text               = "";
     this.tb_Departamento.Text       = "";
     this.tb_Localidad.Text          = "";
     this.tb_Nombre_de_contacto.Text = "";
     this.tb_Piso.Text               = "";
     this.tb_Razon_Social.Text       = "";
     this.tb_Telefono.Text           = "";
     this.tb_Username.Text           = "";
     this.dp_Fecha_de_creacion.Value = DateManager.Ahora();
 }
 protected override void AccionLimpiar()
 {
     this.tb_Apellido.Text            = "";
     this.tb_Calle.Text               = "";
     this.tb_Codigo_postal.Text       = "";
     this.tb_Contraseña.Text          = "";
     this.tb_Correo_electronico.Text  = "";
     this.tb_Departamento.Text        = "";
     this.tb_Localidad.Text           = "";
     this.tb_Nombre.Text              = "";
     this.tb_Nombre_de_usuario.Text   = "";
     this.tb_Numero_de_documento.Text = "";
     this.tb_Piso.Text                       = "";
     this.tb_Telefono.Text                   = "";
     this.tb_Altura.Text                     = "";
     this.dp_Fecha_de_nacimiento.Value       = DateManager.Ahora();
     this.cb_Sexo.SelectedIndex              = 0;
     this.cb_Tipo_de_documento.SelectedIndex = 0;
 }
Ejemplo n.º 17
0
        protected override void AccionIniciar()
        {
            this.AgregarValidacion(new ValidadorString(this.tb_Nombre_de_contacto, 1, 255));
            this.AgregarValidacion(new ValidadorString(this.tb_Contraseña, 1, 255));
            this.AgregarValidacion(new ValidadorString(this.tb_Razon_Social, 1, 255));
            this.AgregarValidacion(new ValidadorString(this.tb_CUIT, 1, 50));
            this.AgregarValidacion(new ValidadorString(this.tb_Correo_electronico, 1, 50));
            this.AgregarValidacion(new ValidadorString(this.tb_Calle, 1, 255));
            this.AgregarValidacion(new ValidadorString(this.tb_Localidad, 1, 255));
            this.AgregarValidacion(new ValidadorString(this.tb_Departamento, 1, 50));
            this.AgregarValidacion(new ValidadorString(this.tb_Codigo_postal, 1, 50));
            this.AgregarValidacion(new ValidadorString(this.tb_Ciudad, 1, 255));
            this.AgregarValidacion(new ValidadorNumerico(this.tb_Telefono));
            this.AgregarValidacion(new ValidadorNumerico(this.tb_Piso));
            this.AgregarValidacion(new ValidadorNumerico(this.tb_Altura));
            this.AgregarValidacion(new ValidadorMail(this.tb_Correo_electronico));
            this.AgregarValidacion(new ValidadorDateTimeUntil(this.dp_Fecha_de_creacion, DateManager.Ahora()));

            this.CargarEmpresaModificar();
        }
Ejemplo n.º 18
0
        private void AltaClientes_Load(object sender, EventArgs e)
        {
            //this.AgregarValidacion(new ValidadorString(this.textBox_Nombre_de_usuario, 1, 255));
            //this.AgregarValidacion(new ValidadorString(this.textBox_Contraseña, 1, 255));
            this.AgregarValidacion(new ValidadorNumerico(this.textBox_Telefono));
            this.AgregarValidacion(new ValidadorCombobox(this.comboBox_Tipo_de_documento));
            this.AgregarValidacion(new ValidadorString(this.textBox_Numero_de_documento, 1, 50));
            this.AgregarValidacion(new ValidadorString(this.textBox_Nombre, 1, 255));
            this.AgregarValidacion(new ValidadorString(this.textBox_Apellido, 1, 255));
            this.AgregarValidacion(new ValidadorString(this.textBox_Correo_electronico, 1, 255));
            this.AgregarValidacion(new ValidadorMail(this.textBox_Correo_electronico));
            this.AgregarValidacion(new ValidadorCombobox(this.comboBox_Sexo));
            this.AgregarValidacion(new ValidadorDateTimeUntil(this.dp_Fecha_de_nacimiento, DateManager.Ahora()));
            this.AgregarValidacion(new ValidadorString(this.textBox_Calle, 1, 255));
            this.AgregarValidacion(new ValidadorNumerico(this.textBox_Piso));
            this.AgregarValidacion(new ValidadorNumerico(this.tb_Altura));
            this.AgregarValidacion(new ValidadorString(this.textBox_Departamento, 1, 50));
            this.AgregarValidacion(new ValidadorString(this.textBox_Codigo_postal, 1, 50));
            this.AgregarValidacion(new ValidadorString(this.textBox_Localidad, 1, 255));

            this.cargarCombos();
        }
        protected override void AccionIniciar()
        {
            this.AgregarValidacion(new ValidadorString(this.tb_Nombre_de_usuario, 1, 255));
            this.AgregarValidacion(new ValidadorString(this.tb_Contraseña, 1, 255));
            //this.AgregarValidacion(new ValidadorNumerico(tb_Telefono));
            this.AgregarValidacion(new ValidadorCombobox(cb_Tipo_de_documento));
            this.AgregarValidacion(new ValidadorString(tb_Numero_de_documento, 1, 50));
            this.AgregarValidacion(new ValidadorString(tb_Nombre, 0, 255));
            this.AgregarValidacion(new ValidadorString(tb_Apellido, 0, 255));
            this.AgregarValidacion(new ValidadorString(tb_Correo_electronico, 1, 255));
            this.AgregarValidacion(new ValidadorMail(tb_Correo_electronico));
            this.AgregarValidacion(new ValidadorCombobox(cb_Sexo));
            this.AgregarValidacion(new ValidadorDateTimeUntil(this.dp_Fecha_de_nacimiento, DateManager.Ahora()));
            this.AgregarValidacion(new ValidadorString(tb_Calle, 1, 255));
            this.AgregarValidacion(new ValidadorNumerico(tb_Piso));
            this.AgregarValidacion(new ValidadorString(tb_Departamento, 1, 255));
            this.AgregarValidacion(new ValidadorString(tb_Codigo_postal, 1, 255));
            //this.AgregarValidacion(new ValidadorString(tb_Localidad, 1, 255));

            this.CargarCombos();
            this.CargarClienteAModificar();
        }
Ejemplo n.º 20
0
 private void RegistroDeEmpresa_Load(object sender, EventArgs e)
 {
     this.AgregarValidacion(new ValidadorString(this.tb_Nombre_de_contacto, 1, 255));
     this.AgregarValidacion(new ValidadorString(this.tb_Contraseña, 1, 255));
     this.AgregarValidacion(new ValidadorString(this.tb_Razon_Social, 1, 255));
     this.AgregarValidacion(new ValidadorString(this.tb_CUIT, 1, 50));
     this.AgregarValidacion(new ValidadorString(this.tb_Correo_electronico, 1, 50));
     this.AgregarValidacion(new ValidadorString(this.tb_Calle, 1, 255));
     this.AgregarValidacion(new ValidadorString(this.tb_Localidad, 1, 255));
     this.AgregarValidacion(new ValidadorString(this.tb_Departamento, 1, 50));
     this.AgregarValidacion(new ValidadorString(this.tb_Codigo_postal, 1, 50));
     this.AgregarValidacion(new ValidadorString(this.tb_Ciudad, 1, 255));
     this.AgregarValidacion(new ValidadorNumerico(this.tb_Telefono));
     this.AgregarValidacion(new ValidadorNumerico(this.tb_Piso));
     this.AgregarValidacion(new ValidadorNumerico(this.tb_Altura));
     this.AgregarValidacion(new ValidadorMail(this.tb_Correo_electronico));
     this.AgregarValidacion(new ValidadorDateTimeUntil(this.dp_Fecha_de_creacion, DateManager.Ahora()));
 }