コード例 #1
0
 private void BtnSuaDocGia_Click(object sender, EventArgs e)
 {
     if (id == -1)
     {
         ErrorMessage("Vui lòng chọn Độc Giả!!!", "Data Check Error");
     }
     else
     {
         if (checkNullForm() == false)
         {
             if (txtTienNo.Text.Equals(""))
             {
                 txtTienNo.Text = "0";
             }
             if (checkDateTime() == false)
             {
                 DocGia dg = new DocGia();
                 dg.SuaDocGia(txtNameDG.Text, datePickerNSDG.Value, txtAddressDG.Text, txtEmailDG.Text, datePickerNgayLapThe.Value, datePickerNgayHetHan.Value, Int16.Parse(txtTienNo.Text), id);
                 loadDocGia();
                 setNullForText();
                 id = -1;
             }
         }
     }
 }
コード例 #2
0
        private void loadDocGia()
        {
            DocGia    dg = new DocGia();
            DataTable dt = dg.LayDSDocGia();

            GridViewDG.DataSource = dt;
        }
コード例 #3
0
 private void BtnThemDocGia_Click(object sender, EventArgs e)
 {
     if (checkNullForm() == false)
     {
         if (txtTienNo.Text.Trim().Equals(""))
         {
             txtTienNo.Text = "0";
         }
         if (checkDateTime() == false)
         {
             DocGia dg = new DocGia();
             dg.ThemDocGia(txtNameDG.Text, datePickerNSDG.Value, txtAddressDG.Text, txtEmailDG.Text, datePickerNgayLapThe.Value, datePickerNgayHetHan.Value, Int16.Parse(txtTienNo.Text));
             loadDocGia();
         }
     }
 }
コード例 #4
0
 private void BtnXoaDocGia_Click(object sender, EventArgs e)
 {
     if (id == -1)
     {
         ErrorMessage("Vui lòng chọn độc giả!!!", "Data Check Error");
     }
     else
     {
         DialogResult dlrs = MessageBox.Show("Bạn có chắc chắn muốn xoá không ?", "Warning !!!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
         if (dlrs == DialogResult.Yes)
         {
             DocGia dg = new DocGia();
             dg.XoaDocGia(id);
             loadDocGia();
             setNullForText();
             id = -1;
         }
         else
         {
             setNullForText();
             id = -1;
         }
     }
 }