Ejemplo n.º 1
0
 private void Reset()
 {
     danKien.YeuCauDung();
     BanDo.Reset();
     danKien.Reset();
     timDongHo.Enabled = false;
     MangToaDoThanhPho.Clear();
 }
Ejemplo n.º 2
0
        public static Bitmap Ve(Size sz, List <Point> DSToaDo, bool DieuChinhDuLieu)
        {
            Bitmap AnhVe;

            AnhVe = new Bitmap(sz.Width, sz.Height);
            Graphics        g          = Graphics.FromImage(AnhVe);
            Pen             penBlack   = new Pen(Color.Black);
            List <ThanhPho> DSThanhPho = new List <ThanhPho>();

            DSThanhPho = BanDo.KhoiTaoThanhPho(DSToaDo);
            return(Ve(sz, DSThanhPho, DieuChinhDuLieu));
        }
Ejemplo n.º 3
0
 private void KhoiTaoBanDo()
 {
     if (ckbSuDungFile.Checked)
     {
         BanDo.KhoiTao(txtFileDuLieu.Text);
         MangToaDoThanhPho = BanDo.DSToaDoThanhPho;
     }
     else
     {
         BanDo.KhoiTao(MangToaDoThanhPho);
     }
 }
Ejemplo n.º 4
0
 private void simpleButtonXN_Click(object sender, EventArgs e)
 {
     if (opt == 1)
     {
         if (txtDuongDan.Text == null || txtTenBanDo.Text == null)
         {
             MessageBox.Show("Bạn phải nhập đủ thông tin", "Lỗi");
         }
         else
         {
             BanDo banDo = new BanDo()
             {
                 DuongDanAnh = txtDuongDan.Text,
                 TenBanDo    = txtTenBanDo.Text
             };
             try
             {
                 Program.banDoSql.CreateMap(banDo);
                 MessageBox.Show("Thêm Thành Công");
                 simpleButtonHuy.Visible = false;
                 simpleButtonXN.Visible  = false;
                 txtDuongDan.ReadOnly    = true;
                 txtTenBanDo.ReadOnly    = true;
                 //txtMKH.ReadOnly = true;
                 loadTable();
             }
             catch (Exception exception)
             {
                 MessageBox.Show("Có lỗi xảy ra");
                 throw;
             }
         }
     }
     else if (opt == 2)
     {
         if (txtDuongDan.Text == null || txtTenBanDo.Text == null)
         {
             MessageBox.Show("Bạn phải nhập đủ thông tin", "Error???");
         }
         else
         {
             try
             {
                 BanDo banDo = new BanDo()
                 {
                     MaBanDo     = Int32.Parse(textEditMaBanDo.Text),
                     DuongDanAnh = txtDuongDan.Text,
                     TenBanDo    = txtTenBanDo.Text
                 };
                 Program.banDoSql.UpdateMap(banDo);
                 MessageBox.Show("Sửa thành công!");
                 simpleButtonHuy.Visible = false;
                 simpleButtonXN.Visible  = false;
                 txtDuongDan.ReadOnly    = true;
                 MessageBox.Show("Cập nhật thành công");
                 loadTable();
             }
             catch (Exception exception)
             {
                 MessageBox.Show("Có lỗi xảy ra");
             }
         }
     }
     else if (opt == 3)
     {
         try
         {
             Program.banDoSql.DeleteMap(Int32.Parse(textEditMaBanDo.Text));
             {
                 MessageBox.Show("Xóa thành công!");
                 simpleButtonHuy.Visible = false;
                 simpleButtonXN.Visible  = false;
                 loadTable();
             }
         }
         catch (Exception exception)
         {
             MessageBox.Show("Có lỗi xảy ra");
         }
     }
     simpleButtonChonDuongDan.Visible = false;
 }