示例#1
0
        public void CapNhatTrangThaiTK()
        {
            QuanLyBanHangQuaMangDataContext dbs = new QuanLyBanHangQuaMangDataContext(Class1.connstr);

            a = Boolean.Parse(dbs.F_LayTinhTrangTK(Class1.username).ToString());
            if (a == true)
            {
                try
                {
                    dbs.SP_CapNhatTrangThaiTaiKhoan(Class1.username);
                    a = false;
                }
                catch (Exception er)
                {
                    MessageBox.Show(er.Message);
                }
            }
        }
示例#2
0
 private void btnTIm_Click(object sender, EventArgs e)
 {
     if (txtTenNhanVien.Text != "")
     {
         try
         {
             QuanLyBanHangQuaMangDataContext dbs = new QuanLyBanHangQuaMangDataContext();
             dgvNV.DataSource = dbs.SP_TimNV(txtTenNhanVien.Text.Trim());
         }
         catch (Exception err)
         {
             MessageBox.Show(err.Message);
         }
     }
     else
     {
         MessageBox.Show("Chưa gõ tên");
     }
 }
示例#3
0
        private void FrmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            DialogResult traloi = new DialogResult();

            traloi = MessageBox.Show("Thoát chương trình", "Trả lời", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (a == true)
            {
                try
                {
                    QuanLyBanHangQuaMangDataContext dbs = new QuanLyBanHangQuaMangDataContext(Class1.connstr);
                    dbs.SP_CapNhatTrangThaiTaiKhoan(Class1.username);
                }
                catch (Exception err)
                {
                    MessageBox.Show(err.Message);
                }
            }
            if (traloi == DialogResult.Yes)
            {
                Application.ExitThread();
            }
        }