Exemple #1
0
        private void activar_formulario_consultas(string us)
        {
            //Activo el thread del formulario de las diferentes consultas

            consultas = new Form4(server);
            consultas.Text = USER;
            consultas.ShowDialog();
        }
Exemple #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (isOK() && textBox1.Text == "root" && textBox2.Text == "123456")
     {
         Form myForm = new Form4();
         myForm.ShowDialog();
     }
     else
     {
         MessageBox.Show("密码错误!请重新输入");
     }
 }
 private void dEVELOPERSToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form4 form = new Form4();
     form.ShowDialog();
 }
Exemple #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     Form4 ofr = new Form4();
     //ofr.MdiParent = this.MdiParent;
     ofr.ShowDialog();
 }
Exemple #5
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     Form4 FormaCzwarta = new Form4(this);
     FormaCzwarta.Owner = this;
     FormaCzwarta.ShowDialog();
 }
Exemple #6
0
 private void openAboutMenu(object sender, EventArgs e)
 {
     Form4 about = new Form4();
     about.ShowDialog();
 }
Exemple #7
0
 private void unlockToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form4 request = new Form4();
     request.ShowDialog();
 }
Exemple #8
0
 //登录按键响应事件
 private void ButtonLogin_Click(object sender, EventArgs e)
 {
     //新建ClassSqlConnect类,调用重构的ViewCount方法返回从数据库中查询的结果
     ClassSqlConnect log = new ClassSqlConnect();
     SqlDataReader reader = log.ViewCount(ComboxUserName.Text.ToString(),TxtPassword.Text.ToString());
     if (reader.Read())//判断有数据,说明登录成功
     {
         /*保存账号信息,将这部分信息保存在数据库(XML)中更好*/
         ComboxUserName.Items.Add(ComboxUserName.Text.ToString());
         Form nfm;
         //提取用户名信息
         string UName = reader[1].ToString();
         MessageBox.Show("欢迎你,"+ UName);
         //提取权限信息并选择应打开的界面
         switch((int)reader[2])
         {
             case 0:
                 nfm = new Form2();//系统管理界面
                 this.Hide();
                 if (nfm.ShowDialog() == DialogResult.OK)
                 {
                     this.Show();
                 }
                 break;
             case 1:
                 nfm = new Form7();//人事经理管理界面
                 this.Hide();
                 if (nfm.ShowDialog() == DialogResult.OK)
                 {
                     this.Show();
                 }
                 break;
             case 2:
                 nfm = new Form3();//人事员工管理界面
                 this.Hide();
                 if (nfm.ShowDialog() == DialogResult.OK)
                 {
                     this.Show();
                 }
                 break;
             case 3:
                 nfm = new Form8();//财务经理管理界面
                 this.Hide();
                 if (nfm.ShowDialog() == DialogResult.OK)
                 {
                     this.Show();
                 }
                 break;
             case 4:
                 nfm = new Form4();//财务员工管理界面
                 this.Hide();
                 if (nfm.ShowDialog() == DialogResult.OK)
                 {
                     this.Show();
                 }
                 break;
             case 5:
                 nfm = new Form9();//销售经理管理界面
                 this.Hide();
                 if (nfm.ShowDialog() == DialogResult.OK)
                 {
                     this.Show();
                 }
                 break;
             case 6:
                 nfm = new Form6();//销售员工管理界面
                 this.Hide();
                 if (nfm.ShowDialog() == DialogResult.OK)
                 {
                     this.Show();
                 }
                 break;
             case 7:
                 nfm = new Form10();//仓库经理管理界面
                 this.Hide();
                 if (nfm.ShowDialog() == DialogResult.OK)
                 {
                     this.Show();
                 }
                 break;
             case 8:
                 nfm = new Form5();//仓库员工管理界面
                 this.Hide();
                 if (nfm.ShowDialog() == DialogResult.OK)
                 {
                     this.Show();
                 }
                 break;
             default:
                 MessageBox.Show("你没有登录权限," + UName,"没有权限");
                 ComboxUserName.Text = "";
                 TxtPassword.Text = "";
                 break;
         }
     }
     else
     {
         MessageBox.Show("用户名或密码错误!","错误");
         TxtPassword.Text = "";
     }
     //调用自定义的Close方法关闭sql连接
     log.Close();
 }
        // V Header Links
        private void dataGridView7_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView7.CurrentCellAddress.X == 4)
            {
                tabControl1.SelectedIndex = 1;
                comboBox6.SelectedIndex = Convert.ToInt32(dataGridView7.CurrentCell.Value);
                return;
            }
            if (dataGridView7.CurrentCellAddress.X == 5 || dataGridView7.CurrentCellAddress.X == 6)
            {
                tabControl1.SelectedIndex = 4;
                comboBox5.SelectedIndex = Convert.ToInt32(dataGridView7.CurrentCell.Value);
                return;
            }
            if (dataGridView7.CurrentCellAddress.X == 7)
            {
                tabControl1.SelectedIndex = 3;
                radioButton15.Checked = true;
                comboBox3.SelectedIndex = Convert.ToInt32(dataGridView7.CurrentCell.Value);
                return;
            }

            if (dataGridView7.CurrentCellAddress.X == 16)
            {
                wildIndex = nameText.IndexOf(dataGridView7.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
                Form4_2 nameEditor = new Form4_2();
                nameEditor.ShowDialog(this);
                dataGridView7.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = nameText[wildIndex];
                return;
            }
            if (dataGridView7.CurrentCellAddress.X == 21)
            {
                mapFlags = Convert.ToInt32(dataGridView7.CurrentCell.Value);
                Form4 flagEditor = new Form4();
                flagEditor.ShowDialog(this);
                dataGridView7.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = mapFlags;
                return;
            }
            if (dataGridView7.CurrentCellAddress.X == 12)
            {
                wildIndex = Convert.ToInt32(dataGridView7.CurrentCell.Value);
                Form9 wildEditor = new Form9();
                wildEditor.ShowDialog(this);
            }
        }
Exemple #10
0
 private void itemsToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     Form4 updateitemform = new Form4();
     if (updateitemform.ShowDialog() == DialogResult.OK)
     {
         updateitemform.Close();
         DataTable dt = new DataTable();
         db.dataGrid(dt, "itemtable");
         dataGridView1.DataSource = dt;
         this.squery = "items";
         textBox1.SelectionStart = textBox1.Text.Length;
         textBox1.Font = new Font(textBox1.Font, FontStyle.Italic);
         textBox1.ForeColor = Color.Gray;
         textBox1.Text = "Items";
         textBox1.Enabled = false;
         textBox1.Enabled = true;
     }
 }
        // Header Links
        private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            // DPPt Links

            if (dataGridView1.CurrentCellAddress.X == 2 && Convert.ToInt32(dataGridView1.CurrentCell.Value) < comboBox12.Items.Count)
            {
                comboBox12.SelectedIndex = Convert.ToInt32(dataGridView1.CurrentCell.Value);
                return;
            }
            if (dataGridView1.CurrentCellAddress.X == 4)
            {
                tabControl1.SelectedIndex = 1;
                comboBox1.SelectedIndex = Convert.ToInt32(dataGridView1.CurrentCell.Value);
                return;
            }
            if (dataGridView1.CurrentCellAddress.X == 5 || dataGridView1.CurrentCellAddress.X == 6)
            {
                tabControl1.SelectedIndex = 4;
                comboBox5.SelectedIndex = Convert.ToInt32(dataGridView1.CurrentCell.Value);
                return;
            }
            if (dataGridView1.CurrentCellAddress.X == 7)
            {
                tabControl1.SelectedIndex = 3;
                comboBox3.SelectedIndex = Convert.ToInt32(dataGridView1.CurrentCell.Value);
                return;
            }
            if (dataGridView1.CurrentCellAddress.X == 10 && (gameID == 0x45414441 || gameID == 0x45415041 || gameID == 0x53414441 || gameID == 0x53415041 || gameID == 0x46414441 || gameID == 0x46415041 || gameID == 0x49414441 || gameID == 0x49415041 || gameID == 0x44414441 || gameID == 0x44415041 || gameID == 0x4A414441 || gameID == 0x4A415041 || gameID == 0x4B414441 || gameID == 0x4B415041 || gameID == 0x45555043 || gameID == 0x53555043 || gameID == 0x46555043 || gameID == 0x49555043 || gameID == 0x44555043 || gameID == 0x4A555043 || gameID == 0x4B555043))
            {
                wildIndex = (int)Convert.ToUInt32(dataGridView1.CurrentCell.Value);
                Form9 wildEditor = new Form9();
                wildEditor.ShowDialog(this);
                return;
            }
            if (dataGridView1.CurrentCellAddress.X == 11 && (gameID == 0x45414441 || gameID == 0x45415041 || gameID == 0x53414441 || gameID == 0x53415041 || gameID == 0x46414441 || gameID == 0x46415041 || gameID == 0x49414441 || gameID == 0x49415041 || gameID == 0x44414441 || gameID == 0x44415041 || gameID == 0x4A414441 || gameID == 0x4A415041 || gameID == 0x4B414441 || gameID == 0x4B415041 || gameID == 0x45555043 || gameID == 0x53555043 || gameID == 0x46555043 || gameID == 0x49555043 || gameID == 0x44555043 || gameID == 0x4A555043 || gameID == 0x4B555043))
            {
                tabControl1.SelectedIndex = 5;
                comboBox10.SelectedIndex = Convert.ToInt32(dataGridView1.CurrentCell.Value);
                return;
            }
            if (dataGridView1.CurrentCellAddress.X == 12 && (gameID == 0x45414441 || gameID == 0x45415041 || gameID == 0x53414441 || gameID == 0x53415041 || gameID == 0x46414441 || gameID == 0x46415041 || gameID == 0x49414441 || gameID == 0x49415041 || gameID == 0x44414441 || gameID == 0x44415041 || gameID == 0x4A414441 || gameID == 0x4A415041 || gameID == 0x4B414441 || gameID == 0x4B415041 || gameID == 0x45555043 || gameID == 0x53555043 || gameID == 0x46555043 || gameID == 0x49555043 || gameID == 0x44555043 || gameID == 0x4A555043 || gameID == 0x4B555043))
            {
                wildIndex = nameText.IndexOf(dataGridView1.CurrentCell.Value.ToString());
                Form4_2 nameEditor = new Form4_2();
                nameEditor.ShowDialog(this);
                dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = nameText[wildIndex];
                return;
            }
            if (dataGridView1.CurrentCellAddress.X == 16 && (gameID == 0x45414441 || gameID == 0x45415041 || gameID == 0x53414441 || gameID == 0x53415041 || gameID == 0x46414441 || gameID == 0x46415041 || gameID == 0x49414441 || gameID == 0x49415041 || gameID == 0x44414441 || gameID == 0x44415041 || gameID == 0x4A414441 || gameID == 0x4A415041 || gameID == 0x4B414441 || gameID == 0x4B415041))
            {
                mapFlags = Convert.ToUInt16(dataGridView1.CurrentCell.Value);
                Form4 flagEditor = new Form4();
                flagEditor.ShowDialog(this);
                dataGridView1.CurrentCell.Value = mapFlags;
                return;
            }

            // Platinum Links

            if (dataGridView1.CurrentCellAddress.X == 17 && (gameID == 0x45555043 || gameID == 0x53555043 || gameID == 0x46555043 || gameID == 0x49555043 || gameID == 0x44555043 || gameID == 0x4A555043 || gameID == 0x4B555043))
            {
                mapFlags = Convert.ToUInt16(dataGridView1.CurrentCell.Value);
                Form4 flagEditor = new Form4();
                flagEditor.ShowDialog(this);
                dataGridView1.CurrentCell.Value = mapFlags;
                return;
            }

            // HGSS Links

            if (dataGridView13.CurrentCellAddress.X == 6)
            {
                tabControl1.SelectedIndex = 1;
                comboBox1.SelectedIndex = Convert.ToInt32(dataGridView13.CurrentCell.Value);
                return;
            }
            if (dataGridView13.CurrentCellAddress.X == 7 || dataGridView13.CurrentCellAddress.X == 8)
            {
                tabControl1.SelectedIndex = 4;
                comboBox5.SelectedIndex = Convert.ToInt32(dataGridView13.CurrentCell.Value);
                return;
            }
            if (dataGridView13.CurrentCellAddress.X == 9)
            {
                tabControl1.SelectedIndex = 3;
                comboBox3.SelectedIndex = Convert.ToInt32(dataGridView13.CurrentCell.Value);
                return;
            }
            if (dataGridView13.CurrentCellAddress.X == 12 && (gameID == 0x454B5049 || gameID == 0x45475049 || gameID == 0x534B5049 || gameID == 0x53475049 || gameID == 0x464B5049 || gameID == 0x46475049 || gameID == 0x494B5049 || gameID == 0x49475049 || gameID == 0x444B5049 || gameID == 0x44475049 || gameID == 0x4A4B5049 || gameID == 0x4A475049 || gameID == 0x4B4B5049 || gameID == 0x4B475049))
            {
                tabControl1.SelectedIndex = 5;
                comboBox10.SelectedIndex = Convert.ToInt32(dataGridView13.CurrentCell.Value);
                return;
            }
            if (dataGridView13.CurrentCellAddress.X == 13 && (gameID == 0x454B5049 || gameID == 0x45475049 || gameID == 0x534B5049 || gameID == 0x53475049 || gameID == 0x464B5049 || gameID == 0x46475049 || gameID == 0x494B5049 || gameID == 0x49475049 || gameID == 0x444B5049 || gameID == 0x44475049 || gameID == 0x4A4B5049 || gameID == 0x4A475049 || gameID == 0x4B4B5049 || gameID == 0x4B475049))
            {
                wildIndex = nameText.IndexOf(dataGridView13.CurrentCell.Value.ToString());
                Form4_2 nameEditor = new Form4_2();
                nameEditor.ShowDialog(this);
                dataGridView13.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = nameText[wildIndex];
                return;
            }
            if (dataGridView13.CurrentCellAddress.X == 2 && (gameID == 0x454B5049 || gameID == 0x45475049 || gameID == 0x534B5049 || gameID == 0x53475049 || gameID == 0x464B5049 || gameID == 0x46475049 || gameID == 0x494B5049 || gameID == 0x49475049 || gameID == 0x444B5049 || gameID == 0x44475049 || gameID == 0x4A4B5049 || gameID == 0x4A475049 || gameID == 0x4B4B5049 || gameID == 0x4B475049))
            {
                wildIndex = (int)Convert.ToUInt32(dataGridView13.CurrentCell.Value);
                Form9 wildEditor = new Form9();
                wildEditor.ShowDialog(this);
                return;
            }
            if (dataGridView13.CurrentCellAddress.X == 18 && (gameID == 0x454B5049 || gameID == 0x45475049 || gameID == 0x534B5049 || gameID == 0x53475049 || gameID == 0x464B5049 || gameID == 0x46475049 || gameID == 0x494B5049 || gameID == 0x49475049 || gameID == 0x444B5049 || gameID == 0x44475049 || gameID == 0x4A4B5049 || gameID == 0x4A475049 || gameID == 0x4B4B5049 || gameID == 0x4B475049))
            {
                mapFlags = Convert.ToUInt16(dataGridView13.CurrentCell.Value);
                Form4 flagEditor = new Form4();
                flagEditor.ShowDialog(this);
                dataGridView13.CurrentCell.Value = mapFlags;
                return;
            }
        }
Exemple #12
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (SignUp.Checked)
            {
                Form2 F2 = new Form2();
                F2.ShowDialog();
                nombre     = F2.SetNombre();
                usuario    = F2.SetUsuario();
                contraseña = F2.SetContraseña();
                // Quiero saber si me he podido dar de alta o no
                string mensaje = "1/" + nombre + "/" + usuario + "/" + contraseña;
                // Enviamos al servidor el nombre tecleado

                byte[] msg = System.Text.Encoding.ASCII.GetBytes(mensaje);
                server.Send(msg);
            }
            else if (LogIn.Checked)
            {
                Form3 F3 = new Form3();

                F3.ShowDialog();
                user_login     = F3.SetUser();
                password_login = F3.SetPassword();
                // Quiere loguearse

                string mensaje = "2/" + user_login + "/" + password_login;
                // Enviamos al servidor el nombre tecleado
                byte[] msg = System.Text.Encoding.ASCII.GetBytes(mensaje);
                server.Send(msg);
            }
            else if (consulta_fecha.Checked)
            {
                Form4 F4 = new Form4();

                F4.ShowDialog();
                fecha = F4.getFecha();

                string mensaje = "3/" + fecha;
                // Enviamos al servidor el nombre tecleado
                byte[] msg = System.Text.Encoding.ASCII.GetBytes(mensaje);
                server.Send(msg);
            }
            else if (consulta_duracion.Checked)
            {
                Form5 F5 = new Form5();
                F5.ShowDialog();
                duracion = F5.getDuracion();

                string mensaje = "4/" + duracion;
                // Enviamos al servidor la duracion que nos han pasado por consola
                byte[] msg = System.Text.Encoding.ASCII.GetBytes(mensaje);
                server.Send(msg);
            }
            else if (consulta_lista.Checked)
            {
                string mensaje = "5/";
                // Enviamos el código pertinente a la solicitud
                byte[] msg = System.Text.Encoding.ASCII.GetBytes(mensaje);
                server.Send(msg);
            }
            else if (invitar.Checked)
            {
                Form6 F6 = new Form6();
                F6.setListado(conectados);
                F6.ShowDialog();
                string invitados = F6.GetListado();
                string mensaje   = "6/" + usuario + "/" + invitados; //    6/anakilator/1/juanito23
                byte[] msg       = System.Text.Encoding.ASCII.GetBytes(mensaje);
                server.Send(msg);
            }
        }
Exemple #13
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form4 frm = new Form4();

            frm.ShowDialog();
        }
Exemple #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool exep = false;

            try
            { string codBarras, nome, descricao, preco, estoque, unidade, tipo;
              codBarras = codigo.Text;
              nome      = nome1.Text;
              descricao = descriçao.Text;
              preco     = preco1.Text;
              estoque   = estoque1.Text;
              unidade   = unid.Text;
              tipo      = tipo1.Text;

              if (string.IsNullOrWhiteSpace(codigo.Text))
              {
                  throw new Exception(" Codigo de barras vazio");
              }
              try
              {
                  Convert.ToInt64(codigo.Text);
              }
              catch
              {
                  throw new Exception(" O codigo de barras deve ser numero");
              }
              if (string.IsNullOrWhiteSpace(nome1.Text))
              {
                  throw new Exception(" Nome está vazio");
              }
              if (string.IsNullOrWhiteSpace(descriçao.Text))
              {
                  throw new Exception(" Descrição está vazio");
              }
              if (string.IsNullOrWhiteSpace(preco1.Text))
              {
                  throw new Exception("Preço está vazio");
              }
              if (string.IsNullOrWhiteSpace(estoque1.Text))
              {
                  throw new Exception(" Estoque está vazio");
              }
              if (string.IsNullOrWhiteSpace(unid.Text))
              {
                  throw new Exception("Unidade está vazio");
              }
              if (string.IsNullOrWhiteSpace(tipo1.Text))
              {
                  throw new Exception(" tipo está vazio");
              }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error);
                exep = true;
            }
            if (exep == false)
            {
                this.Hide();
                Form4 OutroForm = new Form4();
                OutroForm.ShowDialog();
                this.Close();
            }
        }
Exemple #15
0
 private void helpToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form4 form4 = new Form4();
     form4.ShowDialog();
 }