private void btnTestConn_Click(object sender, EventArgs e)
        {
            try
            {
                // expresion regular para ips
                // si se ingresa una ip, no es valida la cadena de entrada
                if (Modelos.Utilerias.esIp(this.tbServidor.Text))
                {
                    throw new Exception("Utilice el nombre del servidor en lugar de su IP");
                }

                Modelos.ConectionString.conn = string.Format(
                    "server={0};User Id={1};password={2};database={3}",
                    this.tbServidor.Text,
                    this.tbUsuario.Text,
                    this.tbContrasenia.Text,
                    this.tbBaseDeDatos.Text);

                this._catalogosNegocio = new CatalogosNegocio();

                Modelos.Login.idSucursal = 0;

                List <Modelos.Sucursales> sucursales = this._catalogosNegocio.getSucursales("A");

                Modelos.Login.idSucursal = null;

                MessageBox.Show("Conexión Exitosa!!!", "Configuración", MessageBoxButtons.OK, MessageBoxIcon.Information);

                this._pruebaCon = true;
            }
            catch (Exception Ex)
            {
                MessageBox.Show("Falló la conexión a la base de datos", "Configuración", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemple #2
0
        public frmModifActivo()
        {
            InitializeComponent();

            this._catalogosNegocio = new CatalogosNegocio();
            this._activosNegocio   = new ActivosNegocio();
        }
Exemple #3
0
 public frmTraspasarResponsiva()
 {
     InitializeComponent();
     this._catalogosNegocio   = new CatalogosNegocio();
     this._responsivasNegocio = new ResponsivasNegocio();
     this._activosTraspaso    = new List <Modelos.Activos>();
 }
        public frmTraspasos()
        {
            InitializeComponent();

            this._catalogosNegocio   = new CatalogosNegocio();
            this._responsivasNegocio = new ResponsivasNegocio();
        }
Exemple #5
0
 public frmResponsivasSucursalXResp()
 {
     InitializeComponent();
     this._catalogosNegocio   = new CatalogosNegocio();
     this._responsivasNegocio = new ResponsivasNegocio();
     this._activosNegocio     = new ActivosNegocio();
 }
        public frmActReparacion()
        {
            InitializeComponent();

            this._catalogosNegocio = new CatalogosNegocio();
            this._activosNegocio   = new ActivosNegocio();
        }
 public frmBuscaUsuarioResp()
 {
     InitializeComponent();
     this._catalogosNegocio   = new CatalogosNegocio();
     this._responsivasNegocio = new ResponsivasNegocio();
     this._activosNegocio     = new ActivosNegocio();
 }
Exemple #8
0
 public frmActivosPersona()
 {
     InitializeComponent();
     this._catalogosNegocio   = new CatalogosNegocio();
     this._responsivasNegocio = new ResponsivasNegocio();
     this._activosNegocio     = new ActivosNegocio();
 }
Exemple #9
0
        public frmBuscaGrupos()
        {
            InitializeComponent();

            this._catalogosNegocio = new CatalogosNegocio();
            this._activosNegocio   = new ActivosNegocio();
        }
Exemple #10
0
 public frmModificaResponsables(int?idResponsiva)
 {
     InitializeComponent();
     this._responsivasNegocio = new ResponsivasNegocio();
     this._catalogosNegocio   = new CatalogosNegocio();
     this._idResponsiva       = idResponsiva;
 }
        private void btnAcceder_Click(object sender, EventArgs e)
        {
            try
            {
                this._catalogosNegocio = new CatalogosNegocio();
                this._permisosNegocio  = new PermisosNegocio();

                // validaciones
                if (string.IsNullOrEmpty(this.tbUsuario.Text))
                {
                    this.ActiveControl = this.tbUsuario;
                    throw new Exception("Llene el campo Usuario");
                }

                if (string.IsNullOrEmpty(this.tbPass.Text))
                {
                    this.ActiveControl = this.tbPass;
                    throw new Exception("Llene el campo Contraseña");
                }

                Response resp = this._catalogosNegocio.validaAcceso(this.tbUsuario.Text, this.tbPass.Text);

                if (resp.status == Estatus.OK)
                {
                    // almacenar credeniales
                    Modelos.Login.idUsuario  = resp.usuario.idUsuario;
                    Modelos.Login.nombre     = resp.usuario.nombre;
                    Modelos.Login.usuario    = resp.usuario.usuario;
                    Modelos.Login.idSucursal = resp.usuario.idSucursal;

                    Modelos.Login.permisos = this._permisosNegocio.getPermisosUsuario(Modelos.Login.idUsuario);

                    if (Modelos.Login.permisos.Contains(49))
                    {
                        Modelos.Login.admin = true;
                    }
                    else
                    {
                        Modelos.Login.admin = false;
                    }

                    // bitacora
                    this._catalogosNegocio.generaBitacora(
                        "Nuevo Acceso a usuario '" + Modelos.Login.nombre.Replace("&", " ") + "'", "ACCESO");

                    this.Hide();
                    new FormPrincipal().ShowDialog();
                    this.Close();
                }
                else
                {
                    throw new Exception(resp.error);
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, "Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemple #12
0
        public frmActivosFechas()
        {
            InitializeComponent();

            // inicializa variables
            this._catalogosNegocio = new CatalogosNegocio();
            this._activosNegocio   = new ActivosNegocio();
        }
Exemple #13
0
        public frmBuscaActReparacion()
        {
            InitializeComponent();


            this._catalogosNegocio    = new CatalogosNegocio();
            this._reparacionesNegocio = new ReparacionesNegocio();
        }
Exemple #14
0
        public frmAgregaResponsables(int?idPersona)
        {
            InitializeComponent();
            this._catalogosNegocio   = new CatalogosNegocio();
            this._responsivasNegocio = new ResponsivasNegocio();

            this._idPersona = (int)idPersona;
        }
Exemple #15
0
        public frmModifContra(string usuario, int idUsuario)
        {
            InitializeComponent();

            this._usuario          = usuario;
            this._idUsuario        = idUsuario;
            this._catalogosNegocio = new CatalogosNegocio();
        }
Exemple #16
0
        public frmConfig()
        {
            InitializeComponent();

            this._catalogosNegocio = new CatalogosNegocio();

            this.tvPermisos.CheckBoxes = true;
            this._permisosNegocio      = new PermisosNegocio();
        }
        public frmConfirmTraspaso(Modelos.Activos activoSel, string usuario)
        {
            InitializeComponent();

            this._activoSel = activoSel;
            this._usuario   = usuario;

            this._catalogosNegocio = new CatalogosNegocio();
        }
        public frmAltaActivo(int idUsuario)
        {
            InitializeComponent();

            this._catalogosNegocio = new CatalogosNegocio();
            this._activosNegocio   = new ActivosNegocio();

            this._idUsuario = idUsuario;
        }
Exemple #19
0
        public frmBuscarResponsiva(string tipoCons)
        {
            InitializeComponent();
            this._catalogosNegocio   = new CatalogosNegocio();
            this._responsivasNegocio = new ResponsivasNegocio();
            this._activosNegocio     = new ActivosNegocio();

            this._tipoCons = tipoCons;
        }
Exemple #20
0
        public frmResponsivas(List <Modelos.Activos> activos)
        {
            InitializeComponent();
            this._catalogosNegocio   = new CatalogosNegocio();
            this._responsivasNegocio = new ResponsivasNegocio();

            this._creaRespActivo = true;
            this._activosResp    = activos;
        }
        public frmModifPuestos(int idPuesto, string nombre, int idSucursal)
        {
            InitializeComponent();

            this._catalogosNegocio = new CatalogosNegocio();

            this._idSucursal = idSucursal;
            this._idPuesto   = idPuesto;
            this._nombre     = nombre;
        }
Exemple #22
0
        public frmModifArea(int idArea, string nombre, int idSucursal)
        {
            InitializeComponent();

            this._catalogosNegocio = new CatalogosNegocio();

            this._idSucursal = idSucursal;
            this._idArea     = idArea;
            this._nombre     = nombre;
        }
Exemple #23
0
        public frmModifSuc(int?idResponsable, string nombre, int idSucursal)
        {
            InitializeComponent();

            this._catalogosNegocio = new CatalogosNegocio();

            this._idSucursal    = idSucursal;
            this._idResponsable = idResponsable;
            this._nombre        = nombre;
        }
        public frmReimpresionBR()
        {
            InitializeComponent();
            this._catalogosNegocio    = new CatalogosNegocio();
            this._reparacionesNegocio = new ReparacionesNegocio();
            this._activosNegocio      = new ActivosNegocio();
            this._responsivasNegocio  = new ResponsivasNegocio();

            this.lbFecha.Location = new Point(8, 327);
            this.tbFecha.Location = new Point(77, 324);
        }
Exemple #25
0
        public frmMovimientosActivos()
        {
            InitializeComponent();

            // acomoda radios
            this.rbPN.Location  = new Point(this.gbPTN.Location.X + 13, this.gbPTN.Location.Y - 1);
            this.rbPNE.Location = new Point(this.gbPNE.Location.X + 13, this.gbPNE.Location.Y - 1);
            this.rbPCA.Location = new Point(this.gbPCA.Location.X + 13, this.gbPCA.Location.Y - 1);

            // inicializa variables
            this._catalogosNegocio = new CatalogosNegocio();
            this._activosNegocio   = new ActivosNegocio();
        }
Exemple #26
0
        public frmReimpresionEtiquetas()
        {
            InitializeComponent();

            // acomoda radios
            this.rbPNE.Location = new Point(this.gbPNE.Location.X + 13, this.gbPNE.Location.Y - 1);
            this.rbPCA.Location = new Point(this.gbPCA.Location.X + 13, this.gbPCA.Location.Y - 1);
            this.rbPTN.Location = new Point(this.gbPTN.Location.X + 13, this.gbPTN.Location.Y - 1);

            this._activosNegocio     = new ActivosNegocio();
            this._catalogosNegocio   = new CatalogosNegocio();
            this._responsivasNegocio = new ResponsivasNegocio();
        }
        public frmModiftipos(int idTipo, string nombre, bool marca, bool modelo, bool serie, bool color, bool costo, bool factura, bool fechaCompra)
        {
            InitializeComponent();

            this._catalogosNegocio = new CatalogosNegocio();

            this._idTipo      = idTipo;
            this._nombre      = nombre;
            this._marca       = marca;
            this._modelo      = modelo;
            this._serie       = serie;
            this._color       = color;
            this._costo       = costo;
            this._factura     = factura;
            this._fechaCompra = fechaCompra;
        }
Exemple #28
0
        public frmBuscaActivos(int?idArea, int?idSucursal)
        {
            InitializeComponent();

            // acomoda radios
            this.rbPTN.Location = new Point(this.gbPTN.Location.X + 13, this.gbPTN.Location.Y - 1);
            this.rbPNE.Location = new Point(this.gbPNE.Location.X + 13, this.gbPNE.Location.Y - 1);
            this.rbPCA.Location = new Point(this.gbPCA.Location.X + 13, this.gbPCA.Location.Y - 1);

            // inicializa variables
            this._catalogosNegocio = new CatalogosNegocio();
            this._activosNegocio   = new ActivosNegocio();


            // TODO: Complete member initialization
            this._idArea     = idArea;
            this._idSucursal = idSucursal;
        }
Exemple #29
0
        public frmBuscActivos(string tipoConsulta)
        {
            InitializeComponent();

            // acomoda radios
            this.rbPN.Location  = new Point(this.gbPTN.Location.X + 13, this.gbPTN.Location.Y - 1);
            this.rbPU.Location  = new Point(this.gbPN_2.Location.X + 13, this.gbPN_2.Location.Y - 1);
            this.rbPNE.Location = new Point(this.gbPNE.Location.X + 13, this.gbPNE.Location.Y - 1);
            this.rbPCA.Location = new Point(this.gbPCA.Location.X + 13, this.gbPCA.Location.Y - 1);

            // inicializa variables
            this._catalogosNegocio = new CatalogosNegocio();
            this._activosNegocio   = new ActivosNegocio();

            this.tbResultCveActivo.Text   = string.Empty;
            this.tbResultNumEtiqueta.Text = string.Empty;

            // tipo de consulta
            this._tipoConsulta = tipoConsulta;
        }
 public frmTipos()
 {
     InitializeComponent();
     this._catalogosNegocio = new CatalogosNegocio();
 }