コード例 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     oracle.LinkToOracle("orcl", "test", "test");//连接数据库
     OracleCommand cmd = oracle.getConnection().CreateCommand();
     String tno = textBox1.Text;
     String pwd = textBox2.Text;
     if (radioButton1.Checked == true)
     {
         cmd.CommandText = String.Format("select * from teacher where tno='{0}'", tno);//从数据库中选出行
         OracleDataReader reader = cmd.ExecuteReader();//把数据赋给reader
         reader.Read();
         if (reader.HasRows)
             if (reader["pwd"].ToString() == pwd)
             {
                 MessageBox.Show("登录成功");
                 oracle.LinkClose();
                 Form5 form5 = new Form5(textBox1.Text);
                 this.Hide();
                 form5.Show();
                 //return;
             }
             else
             {
                 MessageBox.Show("用户名不存在或者密码错误");
                 oracle.LinkClose();
             }
     }
     else{
         cmd.CommandText = String.Format("select * from teacher where tno='{0}'", "m123");//从数据库中选出行
         OracleDataReader reader = cmd.ExecuteReader();//把数据赋给reader
         reader.Read();
         if (reader.HasRows)
             if (reader["pwd"].ToString() == pwd)
             {
                 MessageBox.Show("登录成功");
                 oracle.LinkClose();
                 Form2 form2 = new Form2();
                 this.Hide();
                 form2.Show();
                 //return;
             }
             else
             {
                 MessageBox.Show("用户名不存在或者密码错误");
                 oracle.LinkClose();
             }
     }
 }
コード例 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         MongoClient          client = new MongoClient("mongodb://localhost");
         MongoServer          server = client.GetServer();
         MongoDatabase        db     = server.GetDatabase("dms");
         MongoCursor <Class1> put    = db.GetCollection <Class1>("u_signup").FindAll();
         foreach (Class1 i in put)
         {
             if (textBox1.Text == i.uname && textBox2.Text == i.password)
             {
                 if (ad == 0)
                 {
                     Form1 f1 = new Form1();
                     f1.Show();
                     this.Hide();
                 }
                 else if (ad == 1)
                 {
                     Form5 f5 = new Form5();
                     f5.Show();
                     this.Hide();
                 }
                 else
                 {
                     MessageBox.Show("Select User Type!");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #3
0
        private void button10_iClick(object sender, EventArgs e)
        {
            Form5 frm = new Form5();

            frm.Show();
        }
コード例 #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            Form5 form = new Form5(); //ดึง form มาใช้

            form.Show();              //แสดง from ที่ดึงมา
        }
コード例 #5
0
        private void label7_Click(object sender, EventArgs e)
        {
            Form5 f5 = new Form5();

            f5.Show();
        }
コード例 #6
0
        private void button5_Click(object sender, EventArgs e)
        {
            MySqlConnection con = new MySqlConnection("server=localhost;user id=root;persistsecurityinfo=True;database=voteme;Password =jaishriRAM0385");


            MySqlCommand cmd = new MySqlCommand("select * from Ulogin where UserId='" + textBox1.Text + "' and Password ='******'", con);

            cmd.CommandType = CommandType.Text;
            cmd.Parameters.AddWithValue("@UserId", textBox1.Text);
            cmd.Parameters.AddWithValue("@Password", textBox2.Text);
            Form2 obj2 = new Form2();

            obj2.id = textBox1.Text;


            con.Open();

            MySqlDataReader dr = cmd.ExecuteReader();

            if (dr.Read())
            {
                Form5 obj1 = new Form5();
                obj1.Show();
                this.Hide();
                obj1.id = textBox1.Text;
            }
            else
            {
                MessageBox.Show("Invalid Username or Password");
                Form1 obj1 = new Form1();
                obj1.Show();
                this.Hide();
            }



            /* string uid, pass;
             * uid = textBox1.Text;
             * pass = textBox2.Text;
             *
             * MySqlConnection con;
             * con = new MySqlConnection();
             * con.ConnectionString = "server=localhost;user id=root;persistsecurityinfo=True;database=voteme";
             *
             * MySqlCommand cmd;
             * //MySqlDataReader reader;
             * //string query;
             * //   cmd = new SqlCommand("SELECT UserId FROM Ulogin WHERE UserId=" + textBox1.Text + " and Password = "******"'", con);
             * try
             * {
             *   con.Open();
             *   string query;
             *   query = "select password from voteme.ulogin where username = '******'";
             *   cmd = new MySqlCommand("SELECT UserId FROM Ulogin WHERE UserId=" + textBox1.Text + " and Password = "******"'", con);
             *   //cmd = new MySqlCommand(query, con);
             *   //reader = cmd.ExecuteReader();
             *   //string upass = query;
             *
             *   //MySqlDataReader dr = cmd.ExecuteReader();
             *
             *   {
             *       Form5 obj1 = new Form5();
             *       obj1.Show();
             *       this.Hide();
             *   }
             *   else
             *   {
             *       MessageBox.Show("Invalid username or password");
             *   }
             *
             *
             *
             *   con.Close(); }
             * catch
             * {
             *   MessageBox.Show("Error!!!!");
             * }
             * finally { con.Dispose();
             * }
             */
            /* MySqlDataAdapter a = new MySqlDataAdapter("select count(*) from ulogin where UserId=" + textBox1.Text + " and Password ="******"'", con);
             * DataTable dt = new DataTable();
             * a.Fill(dt);
             * if (dt.Rows[0][0].ToString()=="1")
             * {
             *   MessageBox.Show("Login Succesfully");
             *   this.Hide();
             *   Form5 obj1 = new Form5();
             *   obj1.Show();
             *
             * }
             * else
             * {
             *   MessageBox.Show("Invalid Username and Password");
             * }
             */
        }
コード例 #7
0
 private void button4_Click(object sender, EventArgs e)
 {
     Form5 f5 = new Form5();
     f5.Show();
 }
コード例 #8
0
        private void button5_Click(object sender, EventArgs e)
        {
            Form5 f5 = new Form5();

            f5.Show();
        }
コード例 #9
0
        private void заказыToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form f5 = new Form5();

            f5.Show();
        }
コード例 #10
0
 private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AboutForm.Show();
 }
コード例 #11
0
        private void оПрогреммеToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form5 d = new Form5();

            d.Show();
        }
コード例 #12
0
        private void button9_Click(object sender, EventArgs e)           //“调度命令模板”按钮
        {
            Form5 form5 = new Form5();

            form5.Show();
        }
コード例 #13
0
ファイル: Form2.cs プロジェクト: henio180/AplikacjeBazodanowe
 private void button3_Click(object sender, EventArgs e)
 {
     this.Visible = false;
     Form5 connectionMode = new Form5();
     connectionMode.Show();
 }
コード例 #14
0
ファイル: Form1.cs プロジェクト: saniainf/BcardBase
 private void первыйToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form5 f2 = new Form5(Managers);
     f2.ShowInTaskbar = false;
     f2.Owner = this;
     f2.Show();
 }
コード例 #15
0
        private void button4_Click(object sender, EventArgs e)
        {
            Form5 ob1 = new Form5();

            ob1.Show();
        }
コード例 #16
0
ファイル: Form3.cs プロジェクト: wenjunjiecn/NCEPU-CS-COURSES
        private void button1_Click(object sender, EventArgs e)
        {
            Form5 a = new Form5();

            a.Show(this);
        }
コード例 #17
0
        private void listaEStudentaveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form5 frm5 = new Form5();

            frm5.Show();
        }
コード例 #18
0
        private void button3_Click(object sender, EventArgs e)
        {
            Form5 f2 = new Form5();

            f2.Show();
        }
コード例 #19
0
        private void button4_Click(object sender, EventArgs e)
        {
            Form Form5 = new Form5();

            Form5.Show();
        }
コード例 #20
0
 private void button1_Click(object sender, EventArgs e)
 {
     Form5 fr = new Form5();
     fr.Show();
 }
コード例 #21
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (txtRefNo.Text == "")
            {
                string    delivary   = "select Delivaryid from salesOrderDelivery";
                DataTable dt3        = d.getDetailByQuery(delivary);
                string    delivaryid = "";
                foreach (DataRow dr in dt3.Rows)
                {
                    delivaryid = dr[0].ToString();
                }
                int       del   = Convert.ToInt32(delivaryid);
                int       deli  = del + 1;
                string    order = "select orderid from orderdetails ";
                DataTable d1    = d.getDetailByQuery(order);
                string    id    = "";
                foreach (DataRow dr in d1.Rows)
                {
                    id = dr[0].ToString();
                }
                if (id == "")
                {
                    id = "1";
                    string insertquery = "insert into  orderdetails values('" + txtCustcode.Text + "','" + dtpdate.Text + "','" + txttotalammount.Text + "')";
                    int    insertrows  = d.saveDetails(insertquery);
                    if (insertrows > 0)
                    {
                        DataGridViewRowCollection rowcollection = gridsalesinvoice.Rows;
                        List <string>             show          = new List <string>();
                        for (int a = 0; a < rowcollection.Count; a++)
                        {
                            DataGridViewRow            currentrow     = rowcollection[a];
                            DataGridViewCellCollection cellcollection = currentrow.Cells;
                            string txtitemcode    = cellcollection[0].Value.ToString();
                            string txtProductName = cellcollection[1].Value.ToString();
                            string txtRate        = cellcollection[2].Value.ToString();
                            string txtQuantity    = cellcollection[3].Value.ToString();
                            string txtAmount      = cellcollection[4].Value.ToString();
                            string Orderid        = id;
                            string query          = "insert into customerorderdescriptions Values('" + Orderid + "','" + txtitemcode + "','" + txtRate + "','" + txtQuantity + "','" + txtAmount + "')";

                            show.Add(query);
                        }

                        int inserirow1 = d.saveDetails(show);
                        if (inserirow1 > 0)
                        {
                            string salesdelivary = "Insert into salesOrderDelivery values('" + id + "','true','" + dtpdate.Text + "')";
                            int    insertrow     = d.saveDetails(salesdelivary);
                            string invoice       = "Insert into salesinvoice values('" + deli + "','" + id + "','" + dtpdate.Text + "')";
                            int    insertrow1    = d.saveDetails(invoice);
                            if (insertrow1 > 0)
                            {
                                MessageBox.Show("details save successfully");
                            }
                            else
                            {
                                MessageBox.Show("details save not successfully");
                            }
                        }
                    }
                }
                else
                {
                    int    id1          = Convert.ToInt32(id);
                    int    id2          = id1 + 1;
                    string Orde         = id2.ToString();
                    string insertquery1 = "insert into  orderdetails values('" + txtCustcode.Text + "','" + dtpdate.Text + "','" + txttotalammount.Text + "')";
                    int    insertrows1  = d.saveDetails(insertquery1);
                    if (insertrows1 > 0)
                    {
                        DataGridViewRowCollection rowcollection1 = gridsalesinvoice.Rows;
                        List <string>             show1          = new List <string>();
                        for (int a = 0; a < rowcollection1.Count; a++)
                        {
                            DataGridViewRow            currentrow     = rowcollection1[a];
                            DataGridViewCellCollection cellcollection = currentrow.Cells;
                            string txtitemcode    = cellcollection[0].Value.ToString();
                            string txtProductName = cellcollection[1].Value.ToString();
                            string txtRate        = cellcollection[2].Value.ToString();
                            string txtQuantity    = cellcollection[3].Value.ToString();
                            string txtAmount      = cellcollection[4].Value.ToString();
                            string Orderid        = id2.ToString();
                            string query          = "insert into customerorderdescriptions Values('" + Orderid + "','" + txtitemcode + "','" + txtRate + "','" + txtQuantity + "','" + txtAmount + "')";

                            show1.Add(query);
                        }

                        int inserirow2 = d.saveDetails(show1);
                        if (inserirow2 > 0)
                        {
                            string salesdelivary = "Insert into salesOrderDelivery values('" + id2.ToString() + "','true','" + dtpdate.Text + "')";
                            int    insertrow     = d.saveDetails(salesdelivary);
                            string invoice       = "Insert into salesinvoice values('" + deli + "','" + id2.ToString() + "','" + dtpdate.Text + "')";
                            int    insertrow2    = d.saveDetails(invoice);
                            if (insertrow2 > 0)
                            {
                                MessageBox.Show("details save successfully");
                            }
                            else
                            {
                                MessageBox.Show("details save not successfully");
                            }
                        }
                    }
                }
            }
            if (txtRefNo.Text != "")
            {
                string    delivary   = "select Delivaryid from salesOrderDelivery";
                DataTable dt3        = d.getDetailByQuery(delivary);
                string    delivaryid = txtRefNo.Text;
                //foreach (DataRow dr in dt3.Rows)
                //{
                //    delivaryid = dr[0].ToString();

                //}
                //int del = Convert.ToInt32(delivaryid);
                //int deli = del + 1;
                string    order = "select Orderid from salesOrderDelivery where Delivaryid ='" + txtRefNo.Text + "' ";
                DataTable d1    = d.getDetailByQuery(order);
                string    id    = "";
                foreach (DataRow dr in d1.Rows)
                {
                    id = dr[0].ToString();
                }
                string    update       = "update orderdetails set totalammount='" + txttotalammount.Text + "'where Orderid='" + id + "'";
                int       c            = d.saveDetails(update);
                string    deletequrri1 = "delete customerorderdescriptions where OrderId='" + id + "'";
                DataTable dt1          = d.getDetailByQuery(deletequrri1);
                string    insertquery  = "insert into  orderdetails values('" + txtCustcode.Text + "','" + dtpdate.Text + "','" + txttotalammount.Text + "')";
                int       insertrows   = d.saveDetails(insertquery);
                if (insertrows > 0)
                {
                    DataGridViewRowCollection rowcollection = gridsalesinvoice.Rows;
                    List <string>             show          = new List <string>();
                    for (int a = 0; a < rowcollection.Count; a++)
                    {
                        DataGridViewRow            currentrow     = rowcollection[a];
                        DataGridViewCellCollection cellcollection = currentrow.Cells;
                        string txtitemcode    = cellcollection[0].Value.ToString();
                        string txtProductName = cellcollection[1].Value.ToString();
                        string txtRate        = cellcollection[2].Value.ToString();
                        string txtQuantity    = cellcollection[3].Value.ToString();
                        string txtAmount      = cellcollection[4].Value.ToString();
                        // string Orderid = id;
                        string query = "insert into customerorderdescriptions Values('" + id + "','" + txtitemcode + "','" + txtRate + "','" + txtQuantity + "','" + txtAmount + "')";

                        show.Add(query);
                    }

                    int inserirow1 = d.saveDetails(show);
                    if (inserirow1 > 0)
                    {
                        string salesdelivary = "Update  salesOrderDelivery set DeliveryDate='" + dtpdate.Text + "' where delivaryid='" + delivaryid + "'";
                        int    insertrow     = d.saveDetails(salesdelivary);
                        string invoic        = "Insert into salesinvoice values('" + txtRefNo.Text + "','" + id + "','" + dtpdate.Text + "')";
                        int    insertrow1    = d.saveDetails(invoic);
                        if (insertrow1 > 0)
                        {
                            MessageBox.Show("details save successfully");
                        }
                        else
                        {
                            MessageBox.Show("details save not successfully");
                        }
                    }
                }
            }
            int id3 = Convert.ToInt32(txtSrNo.Text);
            int id4 = id3 + 1;

            txtSrNo.Text = id4.ToString();
            Form5 s = new Form5(id3.ToString());

            s.Show();
            makeblank();
        }
コード例 #22
0
ファイル: Form1.cs プロジェクト: KristinaPetrova/fail
        private void form5ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form5 frm = new Form5();

            frm.Show();
        }
コード例 #23
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            Form5 yeni = new Form5();

            yeni.Show();
        }
コード例 #24
0
ファイル: Form1.cs プロジェクト: vladbatalan/MathAplication
        public void Afisare_Forma(string Text_Forma, Form frn, string Close_or_Hide)
        {
            Form f = new Form();

            switch (Text_Forma)
            {
            case "MENIU": f = new Form1(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "LECTII": f = new Form2(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA INTRODUCERE1":
                f = new Form3(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA INTRODUCERE2":
                f = new Form4(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA INTRODUCERE3":
                f = new Form5(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI1":
                f = new Form6(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI2":
                f = new Form7(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI3":
                f = new Form8(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI4":
                f = new Form9(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI5":
                f = new Form10(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA CAZURI6":
                f = new Form11(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "CONGRUENTA DREPTUNGHICE":
                f = new Form12(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "TESTE":
                f = new Form16(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "TEST USOR":
                f = new Test_Usor_Pagina_1(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "TEST MEDIU":
                f = new Test_Mediu(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;

            case "TEST GREU":
                f = new Test_Greu(); f.Show();
                Verifica_daca_Close_sau_Hide(Close_or_Hide, frn);
                break;
            }
        }
コード例 #25
0
ファイル: Form1_Specimen.cs プロジェクト: 777ondro/sw-en
 private void showForm5ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form5 objektForm5 = new Form5();
     objektForm5.Show();
 }
コード例 #26
0
        private void btnGoTOAdptiveHuffman_Click(object sender, EventArgs e)
        {
            Form5 form5 = new Form5();

            form5.Show();
        }
コード例 #27
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            Form5 f5 = new Form5();

            f5.Show();
        }
コード例 #28
0
ファイル: Form1.cs プロジェクト: jofeew/CRJR_703
 private void portátilToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form5 form5 = new Form5();
     form5.MdiParent = this;
     form5.Show();
 }