private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                con.GetConnection();

                OleDbCommand    com = new OleDbCommand("Select * from fees where ID = '" + textBox15.Text + "' ", con.con);
                OleDbDataReader rd  = com.ExecuteReader();
                while (rd.Read())
                {
                    textBox2.Text  = rd["Jan"].ToString();
                    textBox1.Text  = rd["Feb"].ToString();
                    textBox5.Text  = rd["Mar"].ToString();
                    textBox4.Text  = rd["Apr"].ToString();
                    textBox7.Text  = rd["May"].ToString();
                    textBox6.Text  = rd["Jun"].ToString();
                    textBox9.Text  = rd["Jul"].ToString();
                    textBox8.Text  = rd["Aug"].ToString();
                    textBox11.Text = rd["Sep"].ToString();
                    textBox10.Text = rd["Oct"].ToString();
                    textBox13.Text = rd["Nov"].ToString();
                    textBox12.Text = rd["Dec"].ToString();
                    textBox3.Text  = rd["Year"].ToString();
                    textBox14.Text = rd["Role"].ToString();
                }
            }
            catch
            {
                MessageBox.Show("error");
            }
        }
        private void ChangePass_Load(object sender, EventArgs e)
        {
            con = new model.Connection();
            con.GetConnection();
            OleDbCommand    com = new OleDbCommand("Select * from info where ID = '" + identity + "' ", con.con);
            OleDbDataReader rd  = com.ExecuteReader();

            while (rd.Read())
            {
                pp = rd["Pass"].ToString();
            }
        }
 private void button3_Click(object sender, EventArgs e)
 {
     model.Connection con = new model.Connection();
     con.GetConnection();
     model.Fee fd = new model.Fee();
     fd.ID   = textBox15.Text;
     fd.role = textBox14.Text;
     fd.year = textBox3.Text;
     fd.Jan  = "not paid";
     fd.feb  = "not paid";
     fd.mar  = "not paid";
     fd.apr  = "not paid";
     fd.may  = "not paid";
     fd.jun  = "not paid";
     fd.jul  = "not paid";
     fd.aug  = "not paid";
     fd.sep  = "not paid";
     fd.oct  = "not paid";
     fd.nov  = "not paid";
     fd.dec  = "not paid";
     con.ExecuteQuery("insert into fees values('" + fd.ID + "','" + fd.year + "','" + fd.role + "','" + fd.Jan + "','" + fd.feb + "','" + fd.mar + "','" + fd.apr + "','" + fd.may + "','" + fd.jun + "','" + fd.jul + "','" + fd.aug + "','" + fd.sep + "','" + fd.oct + "','" + fd.nov + "','" + fd.dec + "')");
     MessageBox.Show("successfully initialize the person");
 }
コード例 #4
0
 public void Submit(FeeCheck s)
 {
     con.GetConnection();
     con.ExecuteQuery("UPDATE fees set [Year]='" + s.year + "',[Role]='" + s.role + "',[Jan]='" + s.Jan + "',[Feb]='" + s.feb + "',[Mar]='" + s.mar + "',[Apr]='" + s.apr + "',[May]='" + s.may + "',[Jun]='" + s.jun + "',[Jul]='" + s.jul + "',[Aug]='" + s.aug + "',[Sep]='" + s.sep + "',[Oct]='" + s.oct + "',[Nov]='" + s.nov + "' and [Dec]='" + s.dec + "' where ID = '" + s.ID + "'");
 }
 private void UpdateResult_Load(object sender, EventArgs e)
 {
     con = new model.Connection();
     con.GetConnection();
 }