コード例 #1
0
ファイル: Managing.cs プロジェクト: y2ket/DoorManaging-Csharp
        private void button1_Click(object sender, EventArgs e)
        {
            Database db = new Database();

            db.init();

            foreach (Control ct in this.Controls)
            {
                if (ct is TextBox)
                {
                    if (((TextBox)ct).Text.Trim().Length < 1)
                    {
                        MessageBox.Show("不能为空!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
            }
            try
            {
                newST.CARD   = txtCard.Text;
                newST.NAME   = txtName.Text;
                newST.CLASS  = txtCLASS.Text;
                newST.SNO    = txtSNO.Text;
                newST.ENABLE = chkEnable.Checked;
                int i = DBO.UpdateStudent(oldST, newST);
                MessageBox.Show(String.Format("{0}个信息已被更新!", i), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception e1)
            {
                DBO.Err(e1);
                MessageBox.Show(e1.Message, "警告!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            //MessageBox.Show(oldST.ID.ToString());
        }
コード例 #2
0
ファイル: AddNew.cs プロジェクト: y2ket/DoorManaging-Csharp
 private void AddNew_Load(object sender, EventArgs e)
 {
     try
     {
         HardDeviceManaging.rec = this;
     }
     catch (Exception ex)
     {
         DBO.Err(ex);
         MessageBox.Show(ex.Message, "警告!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #3
0
ファイル: Managing.cs プロジェクト: y2ket/DoorManaging-Csharp
        private void Managing_Load(object sender, EventArgs e)
        {
            oldST = DBO.getStudent(this.Tag.ToString());

            txtCard.Text  = oldST.CARD;
            txtCLASS.Text = oldST.CLASS;

            txtName.Text      = oldST.NAME;
            txtSNO.Text       = oldST.SNO;
            chkEnable.Checked = oldST.ENABLE;
            newST             = new Entities.Students();
            try
            {
                HardDeviceManaging.rec = this;
            }
            catch (Exception ex)
            {
                DBO.Err(ex);
                MessageBox.Show(ex.Message, "警告!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     dataGridView1.DataSource = DBO.getEventLogs(txtCard.Text, txtMC.Text, txtXH.Text, txtBJ.Text);
 }
コード例 #5
0
 private void ViewInformation_Load(object sender, EventArgs e)
 {
     dataGridView1.DataSource = DBO.getEventLogs(txtCard.Text, txtMC.Text, txtXH.Text, txtBJ.Text);
 }
コード例 #6
0
 private void ViewInformation_Load(object sender, EventArgs e)
 {
     dataGridView1.DataSource = DBO.getStudents();
 }