コード例 #1
0
        private void btnLuulop_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            btnThemlop.Enabled     = true;
            btnLuulop.Enabled      = btnHuybolop.Enabled = btnXacnhanlop.Enabled = false;
            lOPGridControl.Enabled = true;

            LopTableAdapter.Update(TTN_DS.LOP);
            LopTableAdapter.Fill(TTN_DS.LOP);
            MessageBox.Show("Cập nhật danh sách thành công");
        }
コード例 #2
0
        private void cbCoSo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbCoSo.SelectedValue != null)
            {
                if (cbCoSo.ValueMember != "")
                {
                    if (Program.servername != cbCoSo.SelectedValue.ToString())
                    {
                        Program.servername = cbCoSo.SelectedValue.ToString();
                    }
                    if (cbCoSo.SelectedIndex != Program.mCoSo)
                    {
                        Program.mlogin   = Program.remotelogin;
                        Program.password = Program.remotepassword;
                    }
                    else
                    {
                        Program.mlogin   = Program.mloginDN;
                        Program.password = Program.passwordDN;
                    }
                    if (Program.KetNoi() == 0)
                    {
                        MessageBox.Show("Không thể kết nối", "Lỗi kết nối", MessageBoxButtons.OK);
                        return;
                    }
                    else
                    {
                        LopTableAdapter.Connection.ConnectionString = Program.connstr;
                        LopTableAdapter.Fill(TTN_DS.LOP);

                        SinhVienTableAdapter.Connection.ConnectionString = Program.connstr;
                        this.SinhVienTableAdapter.Fill(this.TTN_DS.SINHVIEN);
                    }
                }
            }
        }