Esempio n. 1
0
        private void CargarListas()
        {
            one = srvEmpresas.GetOne(Globals.logEmpresa.id);

            _listaMonedas            = srvListas.GetListByCampo("monedas");
            lstMonedas.DataSource    = _listaMonedas;
            lstMonedas.DisplayMember = "nombre";
            lstMonedas.ValueMember   = "id";

            cmbMonedaDefecto.DataSource    = _listaMonedas;
            cmbMonedaDefecto.DisplayMember = "nombre";
            cmbMonedaDefecto.ValueMember   = "id";
            cmbMonedaDefecto.DataBindings.Add("SelectedValue", one, "moneda_defecto", true, DataSourceUpdateMode.OnPropertyChanged);

            _listaInstrumentos            = srvListas.GetListByCampo("instrumento_pago");
            lstInstrumentos.DataSource    = _listaInstrumentos;
            lstInstrumentos.DisplayMember = "nombre";
            lstInstrumentos.ValueMember   = "id";

            lstMonedas.ClearSelected();
            lstInstrumentos.ClearSelected();

            SetSeleccion(Globals.logEmpresa.monedas, lstMonedas);
            SetSeleccion(Globals.logEmpresa.instrumentos_pago, lstInstrumentos);
        }
Esempio n. 2
0
        public frmSplashScreen()
        {
            InitializeComponent();

            aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            aTimer.Interval = 5000;
            aTimer.Enabled  = true;
            Console.WriteLine("Hello World!");

            SisEmpresaClient srvEmpresa = new SisEmpresaClient();
            string           idEmpresa  = ConfigurationManager.AppSettings["id_empresa"];

            Globals.logEmpresa = srvEmpresa.GetOne(idEmpresa);
        }
Esempio n. 3
0
        public frmDashboard()
        {
            InitializeComponent();
            //CheckImpresoraFiscal();

            //EMPRESA
            Globals.logEmpresa = srvEmpresa.GetOne(Globals.logUser.id_empresa);

            Console.WriteLine("EMPRESA");
            string s = new JavaScriptSerializer().Serialize(Globals.logEmpresa);

            Console.WriteLine(s);

            string miMoneda = Globals.logEmpresa.moneda_defecto;

            if (Globals.logEmpresa.es_modo_fiscal)
            {
                miMoneda = "11E93A6F6D57549E838500E04C6F7E24";

                lblCotizacion.Visible     = false;
                dgvListCotizacion.Visible = false;
            }

            string id_cotizacion = "";

            lblEmpresa.Text = Globals.logEmpresa.nombre;
            lblRIF.Text     = Globals.logEmpresa.rif;
            lblFecha.Text   = DateTime.Now.ToString("dd/MM/yyyy");
            CargarListas();
            ConfigurarResumen();

            //COTIZACION
            //List<CnfCotizacionDetalle> cotizacion = srvCotizacion.GetLast(Globals.logEmpresa.id);
            Globals.cotizacion = _listaCotizacion;
            Globals.ConfigurarComboMonedas(cmbCotizacion);

            foreach (CnfCotizacionDetalle item in _listaCotizacion)
            {
                if (item.id_moneda == miMoneda)
                {
                    id_cotizacion = item.id;
                }
            }

            cmbCotizacion.SelectedValue = id_cotizacion;
        }
Esempio n. 4
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            ValidarTextos();

            SisUsuarios one = new SisUsuarios();

            try
            {
                one = srv.Login(txtNombre.Text, GetSHA1(txtPassword.Text));
                //Console.WriteLine($"usuario: {one.es_inactivo.ToString()} empresa: {one.empresa_inactiva.ToString()}");

                if (one != null)
                {
                    if (one.es_inactivo == false && one.empresa_inactiva == false)
                    {
                        Globals.logUser = one;
                        SisEmpresaClient srvEmpresa = new SisEmpresaClient();
                        Globals.logEmpresa = srvEmpresa.GetOne(Globals.logUser.id_empresa);
                        frmMain myForm = new frmMain();
                        myForm.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Usuario Inactivo");
                        txtNombre.Text   = "";
                        txtPassword.Text = "";
                        txtNombre.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("Fallo en la autenticación", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    txtNombre.Text   = "";
                    txtPassword.Text = "";
                    txtNombre.Focus();
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Iniciando el Servicio: " + ex.Message);
                Application.Exit();
            }
        }
Esempio n. 5
0
        public frmSplashScreen()
        {
            InitializeComponent();
            try
            {
                SisEmpresaClient  srvEmpresa  = new SisEmpresaClient();
                SisUsuariosClient srvUsuarios = new SisUsuariosClient();
                string            idEmpresa   = ConfigurationManager.AppSettings["id_empresa"];
                Globals.logEmpresa = srvEmpresa.GetOne(idEmpresa);

                List <SisUsuarios> listado = srvUsuarios.GetList(idEmpresa);
                Globals.listaUsuarios = listado.Where(o => o.es_inactivo == false).ToList();
                Globals.listaUsuarios = Globals.listaUsuarios.OrderBy(o => o.numero).ToList();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Iniciando el Servicio: " + ex.Message);
                Application.Exit();
            }
        }