コード例 #1
0
        public DetallePago(int idPago, bool admin)
        {
            InitializeComponent();

            if (admin == false)
            {
                btnAnular.Enabled = false;
            }

            FormInstance.puntoDecimal();
            pago = PagoDBM.ObtenerPagoIdPago(idPago);

            txtFecha.Text       = pago.FECHA_ABONO;
            txtMonto.Text       = pago.MONTO.ToString();
            txtDescripcion.Text = pago.DESCRIPCION;
            txtTarjeta.Text     = pago.TARJETA;
            txtBanco.Text       = pago.BANCO;
            txtCheque.Text      = pago.CHEQUE;

            idPago = pago.ID_PAGO;

            if (pago.MONTO == 0)
            {
                btnAnular.Enabled        = false;
                txtDescripcion.Text      = "ANULADO";
                txtDescripcion.ForeColor = Color.Red;
            }
        }
コード例 #2
0
 public Añadir_egreso()
 {
     InitializeComponent();
     carga();
     //SUPER IMPORTANTE D:
     FormInstance.puntoDecimal();
 }
コード例 #3
0
        public agregar_producto()
        {
            InitializeComponent();
            Autocomplete();

            //SUPER IMPORTANTE D:
            FormInstance.puntoDecimal();
        }
コード例 #4
0
ファイル: cambiar_estado.cs プロジェクト: Ernesteins/sercor
        public cambiar_estado(Trabajo trb)
        {
            InitializeComponent();

            FormInstance.puntoDecimal();

            codigo = trb.ID;

            txtCodigo.Text           = trb.ID.ToString();
            chklEstado.SelectedIndex = trb.ESTADO - 1;
        }
コード例 #5
0
ファイル: editar_producto.cs プロジェクト: Ernesteins/sercor
        public editar_producto(Producto producto)
        {
            InitializeComponent();

            FormInstance.puntoDecimal();

            codigo = producto.COD;

            string[] armaLuna;
            armaLuna = producto.DESCRIPCION.Split('|');
            if (armaLuna.Length == 2)
            {
                txtDescripcion.Text = armaLuna[1];
                if (armaLuna[0] == "ARMA")
                {
                    rd3.Checked = true;
                }
                else
                {
                    rd4.Checked = true;
                }
            }
            else
            {
                txtDescripcion.Text = armaLuna[0];
                rd5.Checked         = true;
            }


            txtCodigo.Text = producto.COD;
            txtNombre.Text = producto.NOMBRE;
            //txtDescripcion.Text = producto.DESCRIPCION;
            txtCategoria.Text    = producto.CATEGORIA;
            txtSubcategoria.Text = producto.SUBCATEGORIA;
            txtExistencia.Text   = Convert.ToString(producto.EXISTENCIA);
            txtPrecio.Text       = Convert.ToString(producto.PRECIO);

            //MessageBox.Show(Convert.ToString(producto.ESTADO));
            if (producto.ESTADO == 1)
            {
                rd2.Checked = true;
            }
            else
            {
                rd1.Checked = true;
            }
        }
コード例 #6
0
ファイル: SDL.cs プロジェクト: Ernesteins/sercor
        public SDL()
        {
            InitializeComponent();
            FormInstance.puntoDecimal();

            StringBuilder  sb  = new StringBuilder();
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Archivo(*.serdl)|*.serdl";
            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                dgvProducto.Rows.Clear();
                this.Text = "SDL | " + ofd.FileName;
                using (System.IO.StreamReader sr = new System.IO.StreamReader(ofd.FileName, false))
                {
                    while (sr.Peek() >= 0)
                    {
                        sb.Append(sr.ReadLine());
                    }
                }
                string[] separate;
                separate = sb.ToString().Split(';');
                separate = separate.Take(separate.Count() - 1).ToArray();
                int contador = 0, contador2 = 0;
                for (int i = 0; i <= separate.Length - 1; i++)
                {
                    if (contador == 0)
                    {
                        dgvProducto.Rows.Add(1);
                    }
                    dgvProducto.Rows[contador2].Cells[contador].Value = separate[i];
                    if (contador != 7)
                    {
                        contador++;
                    }
                    else
                    {
                        contador = 0;
                        contador2++;
                    }
                }
            }
        }
コード例 #7
0
ファイル: login.cs プロジェクト: Ernesteins/sercor
        private void loginVoid()
        {
            if (txtUser.Text == "")
            {
                MessageBox.Show("No ha ingresado un usuario", "Sercor", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtUser.Focus();
            }
            else if (txtPsw.Text == "")
            {
                MessageBox.Show("No ha ingresado su contraseña", "Sercor", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtPsw.Focus();
            }
            else
            {
                UsuarioSeleccionado = UsuarioDBM.ObtenerUsuarioPorUsuario(txtUser.Text);
                if (UsuarioSeleccionado != null)
                {
                    string passHashed = UsuarioSeleccionado.CONTRASENA;

                    string passUnhash = Hash.sha256(txtPsw.Text);
                    //crear temporalmente una app aparte, para al momento de presentar registrar usuario con Hash
                    if (passHashed == passUnhash)
                    {
                        bool[] privilegio1 = Privilegio(UsuarioSeleccionado.PRIVILEGIO1);
                        bool[] privilegio2 = Privilegio(UsuarioSeleccionado.PRIVILEGIO2);

                        FormInstance.mainWindow(UsuarioSeleccionado, this, privilegio1, privilegio2);
                        this.Enabled = false;
                    }
                    else
                    {
                        MessageBox.Show("Credenciales erróneas", "Sercor", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                }
            }
        }