コード例 #1
0
 private void button6_Click(object sender, EventArgs e)
 {
     if (obtieneAjustes())
     {
         if (!revisaCaja())
         {
             var forma = new frm_aperturaCaja(idSucursal, userName, nameUser);
             if (forma.ShowDialog() != DialogResult.OK)
             {
             }
             else
             {
                 obtieneCaja();
                 frm_devoluciones frm = new frm_devoluciones(nameUser, rolUser, userName, idSucursal, codigoCaja);
                 frm.Show();
             }
         }
         else
         {
             obtieneCaja();
             frm_devoluciones frm = new frm_devoluciones(nameUser, rolUser, userName, idSucursal, codigoCaja);
             frm.Show();
         }
     }
     else
     {
         obtieneCaja();
         frm_devoluciones frm = new frm_devoluciones(nameUser, rolUser, userName, idSucursal, codigoCaja);
         frm.Show();
     }
 }
コード例 #2
0
        public frm_completaDevolucion(string factura, string user, string sucursal, string cliente, string nombre, string total)
        {
            InitializeComponent();
            idSucursal           = sucursal;
            codigoFactura        = factura;
            nombreUsuario        = nombre;
            totalFactura         = total;
            label6.Text          = cliente;
            label3.Text          = factura;
            usuario              = user;
            radioButton2.Checked = true;
            DateTime today = DateTime.Now;

            textBox5.Text = today.ToString("yyyy-MM-dd");
            if (obtieneAjustes())
            {
                if (!revisaCaja())
                {
                    var forma = new frm_aperturaCaja(idSucursal, user, nombreUsuario);
                    if (forma.ShowDialog() != DialogResult.OK)
                    {
                        this.Enabled = false;
                    }
                    obtieneCaja();
                }
                else
                {
                    obtieneCaja();
                }
            }
            else
            {
                obtieneCaja();
            }
        }
コード例 #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (obtieneAjustes())
     {
         if (!revisaCaja())
         {
             if (privilegios[0] == true)
             {
                 var forma = new frm_aperturaCaja(idSucursal, userName, nameUser);
                 if (forma.ShowDialog() == DialogResult.OK)
                 {
                     obtieneCaja();
                     frm_venta frm = new frm_venta(nameUser, rolUser, userName, idSucursal, nombreSucursal, codigoCaja, privilegios);
                     if (codigo != "")
                     {
                         frm.textBox11.Text = codigo;
                         frm.textBox11.Focus();
                         SendKeys.Send("{ENTER}");
                     }
                     frm.Show();
                 }
             }
             else
             {
                 DialogResult result;
                 result = MessageBox.Show("ACTUALMENTE NO CUENTAS CON LOS PRIVILEGIOS PARA APERTURAR UNA CAJA ¿DESEA INGRESAR CREDENCIALES DE ADMINISTRADOR?", "TRASLADO DE MERCADERIA", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                 if (result == System.Windows.Forms.DialogResult.Yes)
                 {
                     var forma = new frm_getCredenciales(null);
                     if (forma.ShowDialog() == DialogResult.OK)
                     {
                         if (forma.currenSesion.getSesion == true)
                         {
                             var formas = new frm_aperturaCaja(idSucursal, userName, nameUser);
                             if (formas.ShowDialog() == DialogResult.OK)
                             {
                                 obtieneCaja();
                                 frm_venta frm = new frm_venta(nameUser, rolUser, userName, idSucursal, nombreSucursal, codigoCaja, privilegios);
                                 if (codigo != "")
                                 {
                                     frm.textBox11.Text = codigo;
                                     frm.textBox11.Focus();
                                     SendKeys.Send("{ENTER}");
                                 }
                                 frm.Show();
                             }
                         }
                     }
                 }
             }
         }
         else
         {
             obtieneCaja();
             frm_venta frm = new frm_venta(nameUser, rolUser, userName, idSucursal, nombreSucursal, codigoCaja, privilegios);
             if (codigo != "")
             {
                 frm.textBox11.Text = codigo;
                 frm.textBox11.Focus();
                 SendKeys.Send("{ENTER}");
             }
             frm.Show();
         }
     }
     else
     {
         obtieneCaja();
         frm_venta frm = new frm_venta(nameUser, rolUser, userName, idSucursal, nombreSucursal, codigoCaja, privilegios);
         if (codigo != "")
         {
             frm.textBox11.Text = codigo;
             frm.textBox11.Focus();
             SendKeys.Send("{ENTER}");
         }
         frm.Show();
     }
 }