Esempio n. 1
0
        private void FormUsuarios_Load(object sender, EventArgs e)
        {
            FormLateral frmLat = new FormLateral();

            frmLat.TopLevel = false;
            frmLat.Parent   = panel1;
            frmLat.Show();
            frmLat.BringToFront();
            ActualizarTabla();
            Globales.f = "Usuarios";
        }
Esempio n. 2
0
        private void FormProductos_Load(object sender, EventArgs e)
        {
            //fgdf
            FormLateral frmLat = new FormLateral();

            frmLat.TopLevel = false;
            frmLat.Parent   = panel1;
            frmLat.Show();
            frmLat.BringToFront();
            ActualizarTabla();
            ActualizarDepartamento();
            Globales.f = "Productos";
        }
Esempio n. 3
0
        private void btnIngresar_Click(object sender, EventArgs e)
        {
            using (ServiceReference1.ServidorWebClient client = new ServiceReference1.ServidorWebClient())
            {
                try
                {
                    String cadena = client.buscarLogin(Convert.ToInt16(txtUser.Text), txtPwd.Text);
                    //DataTable dt = (DataTable)JsonConvert.DeserializeObject(client.buscarLogin(Convert.ToInt16(txtUser.Text), txtPwd.Text), typeof(DataTable));
                    //String permiso = dt.Rows[8].ToString();
                    String permiso = cadena.Substring(cadena.Length - 3, 1);
                    if (cadena != "[]")
                    {
                        FormMenuPrincipal formMenuPrincipal = new FormMenuPrincipal();
                        FormLateral       formLat           = new FormLateral();
                        formMenuPrincipal.Show();
                        if (permiso == "0")
                        {
                            formMenuPrincipal.btnUsers.Enabled         = false;
                            formMenuPrincipal.btnUsers.BackColor       = Color.Gray;
                            formMenuPrincipal.btnProveedores.Enabled   = false;
                            formMenuPrincipal.btnProveedores.BackColor = Color.Gray;

                            formLat.btnUsers.Enabled         = false;
                            formLat.btnUsers.BackColor       = Color.Gray;
                            formLat.btnProveedores.Enabled   = false;
                            formLat.btnProveedores.BackColor = Color.Gray;
                        }
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Id de usuario o contraseña incorrectos.");
                        txtPwd.Text  = "";
                        txtUser.Text = "";
                    }
                }
                catch
                {
                    MessageBox.Show("No sirvio :(");
                }
            }
        }
Esempio n. 4
0
        private void FormProveedores_Load(object sender, EventArgs e)
        {
            FormLateral frmLat = new FormLateral();

            frmLat.TopLevel = false;
            frmLat.Parent   = panel1;
            frmLat.Show();
            frmLat.BringToFront();
            using (ServiceReference1.ServidorWebClient client = new ServiceReference1.ServidorWebClient())
            {
                try
                {
                    DataTable dt = (DataTable)JsonConvert.DeserializeObject(client.cargarProveedor(), typeof(DataTable));

                    dgvTabla.DataSource = dt;
                }
                catch
                {
                    MessageBox.Show("No sirvio :(");
                }
            }
            Globales.f = "Proveedores";
        }