/// <summary>
        /// Hàm cập nhật hộ chiếu
        /// </summary>
        /// <param name="value">hộ chiếu cần cập nhật</param>
        /// <returns>bool</returns>
        public static bool CapNhatHoChieu(HoChieu value)
        {
            String     sql  = "UPDATE HoChieu SET TenHoChieu = '" + value.TenHoChieu + "', ChieuCaoTang = '" + value.ChieuCaoTang + "', QuyMoDotNo ='" + value.QuyMoDotNo + "', MaCongTruong = '" + value.MaCongTruong + "', MaDatDa = '" + value.MaDatDa + "', MaMayKhoan = '" + value.MaMayKhoan + "', MaKipNo = '" + value.MaKipNo + "', MaThuocNo = '" + value.MaThuocNo + "', MaPPNo = '" + value.MaPPNo + "', MaPhuKien = '" + value.MaPhuKien + "', MaCapDo = '" + value.MaCapDo + "', NgayLap = '" + value.NgayLap + "', HeSoKC = '" + value.HeSoKC + "', KichThuoc_X = '" + value.KichThuoc_X + "', KichThuoc_Y = '" + value.KichThuoc_Y + "' WHERE MaHoChieu = '" + value.MaHoChieu + "'";
            Connection conn = new Connection();

            return(conn.SetData(sql));
        }
        /// <summary>
        /// Hàm thêm hộ chiếu
        /// </summary>
        /// <param name="value">hộ chiếu cần thêm</param>
        /// <returns>bool</returns>
        public static bool ThemHoChieu(HoChieu value)
        {
            String     sql  = "INSERT INTO HoChieu (MaBanVe, TenHoChieu, ChieuCaoTang, QuyMoDotNo, MaCongTruong, MaDatDa, MaMayKhoan, MaKipNo, MaThuocNo, MaPPNo, MaPhuKien, MaCapDo, NgayLap, HeSoKC, KichThuoc_X, KichThuoc_Y) VALUES ('" + value.MaBanVe + "', '" + value.TenHoChieu + "', '" + value.ChieuCaoTang + "', '" + value.QuyMoDotNo + "', '" + value.MaCongTruong + "', '" + value.MaDatDa + "', '" + value.MaMayKhoan + "', '" + value.MaKipNo + "', '" + value.MaThuocNo + "', '" + value.MaPPNo + "', '" + value.MaPhuKien + "', '" + value.MaCapDo + "', '" + value.NgayLap + "', '" + value.HeSoKC + "', '" + value.KichThuoc_X + "', '" + value.KichThuoc_Y + "')";
            Connection conn = new Connection();

            return(conn.SetData(sql));
        }
 /// <summary>
 /// Hàm lấy thông tin hộ chiếu nổ mìn
 /// </summary>
 /// <param name="id">mã hộ chiếu</param>
 /// <returns>HoChieu</returns>
 public static HoChieu HoChieu(String id)
 {
     HoChieu hoChieu = new HoChieu();
     Connection conn = new Connection();
     string sql = "SELECT * FROM HoChieu WHERE MaHoChieu = '" + id + "'";
     SQLiteDataReader dr = conn.GetData(sql);
     while (dr.Read())
     {
         hoChieu = new HoChieu(dr["MaHoChieu"].ToString(), dr["MaBanVe"].ToString(), dr["TenHoChieu"].ToString(), ((dr["ChieuCaoTang"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["ChieuCaoTang"])), ((dr["QuyMoDotNo"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["QuyMoDotNo"])), dr["MaCongTruong"].ToString(), dr["MaDatDa"].ToString(), dr["MaMayKhoan"].ToString(), dr["MaKipNo"].ToString(), dr["MaThuocNo"].ToString(), dr["MaPPNo"].ToString(), dr["MaPhuKien"].ToString(), dr["MaCapDo"].ToString(), dr["NgayLap"].ToString(), ((dr["HeSoKC"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["HeSoKC"])), ((dr["KichThuoc_X"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["KichThuoc_X"])), ((dr["KichThuoc_Y"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["KichThuoc_Y"])));
     }
     return hoChieu;
 }
        /// <summary>
        /// Hàm lấy thông tin hộ chiếu nổ mìn
        /// </summary>
        /// <param name="id">mã hộ chiếu</param>
        /// <returns>HoChieu</returns>
        public static HoChieu HoChieu(String id)
        {
            HoChieu          hoChieu = new HoChieu();
            Connection       conn    = new Connection();
            string           sql     = "SELECT * FROM HoChieu WHERE MaHoChieu = '" + id + "'";
            SQLiteDataReader dr      = conn.GetData(sql);

            while (dr.Read())
            {
                hoChieu = new HoChieu(dr["MaHoChieu"].ToString(), dr["MaBanVe"].ToString(), dr["TenHoChieu"].ToString(), ((dr["ChieuCaoTang"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["ChieuCaoTang"])), ((dr["QuyMoDotNo"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["QuyMoDotNo"])), dr["MaCongTruong"].ToString(), dr["MaDatDa"].ToString(), dr["MaMayKhoan"].ToString(), dr["MaKipNo"].ToString(), dr["MaThuocNo"].ToString(), dr["MaPPNo"].ToString(), dr["MaPhuKien"].ToString(), dr["MaCapDo"].ToString(), dr["NgayLap"].ToString(), ((dr["HeSoKC"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["HeSoKC"])), ((dr["KichThuoc_X"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["KichThuoc_X"])), ((dr["KichThuoc_Y"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["KichThuoc_Y"])));
            }
            return(hoChieu);
        }
        /// <summary>
        /// Hàm tạo hộ chiếu
        /// </summary>
        /// <param name="tenHoChieu">Tên hộ chiếu</param>
        /// <returns>ID hộ chiếu vừa tạo</returns>
        public static String TaoHoChieu(String idTemplate, String tenHoChieu)
        {
            Connection       conn = new Connection();
            SQLiteDataReader dr;
            HoChieu          hoChieuVuaTao = new HoChieu();
            bool             flag          = true;
            //kiểm tra tên hộ chiếu có trùng ko
            List <HoChieu> danhSachHoChieu = BS_HoChieu.DanhSachHoChieu();

            foreach (HoChieu value in danhSachHoChieu)
            {
                if (value.TenHoChieu == tenHoChieu)
                {
                    flag = false; break;
                }
            }
            //nếu ko trùng => tạo hộ chiếu mới, trả về id hộ chiếu vừa tạo
            if (flag)
            {
                //tạo bản vẽ mới cho hộ chiếu
                String idBanVe = BS_BanVe.TaoBanVe(idTemplate, tenHoChieu);
                if (idBanVe == null)
                {
                    return(null);
                }
                else
                {
                    String sql = "INSERT INTO HoChieu (MaBanVe, TenHoChieu, NgayLap) VALUES ('" + idBanVe + "', '" + tenHoChieu + "', '" + DateTime.Now.ToString() + "')";
                    conn.SetData(sql);
                    sql = "SELECT * FROM HoChieu WHERE TenHoChieu = '" + tenHoChieu + "'";
                    dr  = conn.GetData(sql);
                    while (dr.Read())
                    {
                        hoChieuVuaTao = new HoChieu(dr["MaHoChieu"].ToString(), dr["MaBanVe"].ToString(), dr["TenHoChieu"].ToString(), ((dr["ChieuCaoTang"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["ChieuCaoTang"])), ((dr["QuyMoDotNo"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["QuyMoDotNo"])), dr["MaCongTruong"].ToString(), dr["MaDatDa"].ToString(), dr["MaMayKhoan"].ToString(), dr["MaKipNo"].ToString(), dr["MaThuocNo"].ToString(), dr["MaPPNo"].ToString(), dr["MaPhuKien"].ToString(), dr["MaCapDo"].ToString(), dr["NgayLap"].ToString(), ((dr["HeSoKC"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["HeSoKC"])), ((dr["KichThuoc_X"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["KichThuoc_X"])), ((dr["KichThuoc_Y"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["KichThuoc_Y"])));
                    }
                    return(hoChieuVuaTao.MaHoChieu);
                }
            }
            //nếu trùng => trả về null
            else
            {
                return(null);
            }
        }
 public FormBaoCaoThongKe(HoChieu _HoChieu)
 {
     InitializeComponent();
     //add text control
     textLabel.Add(labelText);
     textLabel.Add(labelText3);
     textLabel.Add(label_GiaTri1);
     textLabel.Add(label_GiaTri2);
     textLabel.Add(label_GiaTri3);
     textLabel.Add(label_GiaTri4);
     textLabel.Add(label_GiaTri5);
     textLabel.Add(label_GiaTri6);
     textLabel.Add(label_GiaTri7);
     //add value control
     valueLabel.Add(labelValue_GiaTri1);
     valueLabel.Add(labelValue_GiaTri2);
     valueLabel.Add(labelValue_GiaTri3);
     valueLabel.Add(labelValue_GiaTri4);
     valueLabel.Add(labelValue_GiaTri5);
     valueLabel.Add(labelValue_GiaTri6);
     valueLabel.Add(labelValue_GiaTri7);
     //add combobox control
     valueComboBox.Add(comboBox_MaHoChieu);
     //add button control
     buttonGroup.Add(buttonTaoMoi);
     //UI
     this.BackColor = Properties.Settings.Default.FormBackgroundColor;
     this.MinimizeBox = false;
     this.MaximizeBox = false;
     foreach (Button b in buttonGroup)
     {
         b.BackColor = Properties.Settings.Default.ButtonColor;
         b.FlatAppearance.BorderSize = 0;
     }
     foreach (Label l in textLabel)
     {
         l.ForeColor = Properties.Settings.Default.TextColor;
     }
     idHoChieu = _HoChieu.MaHoChieu;
     comboBox_MaHoChieu.DataSource = BS_HoChieu.DanhSachHoChieu();
     comboBox_MaHoChieu.DisplayMember = "TenHoChieu";
     comboBox_MaHoChieu.Text = _HoChieu.TenHoChieu;
 }
 private void loadFile_FormMoBanVeDatabase(String idHoChieu)
 {
     this.hoChieuChinh = BS_HoChieu.HoChieu(idHoChieu);
     this.banVeChinh = BS_BanVe.BanVe(this.hoChieuChinh.MaBanVe);
     List<LoKhoan> danhSachLoKhoan = BS_LoKhoan.DanhSachLoKhoan(idHoChieu);
     List<Circle> danhSachCircle = new List<Circle>();
     mgCircles = new ManageCircle();
     //dựng bản vẽ mới          
     //this.banVeChinh.HienKhoangCach = false;
     this.Text = "Bản vẽ: [" + this.banVeChinh.TenBanVe + "]";
     Lcad.DrwLoad(hDrw, BS_Template.ChonTemplate(this.banVeChinh.Template).DuongDan, this.Handle, hWnd);
     layerLoMin = Lcad.DrwAddLayer(hDrw, "LoMin", "cyan", 0, Lcad.LC_LWEIGHT_DEFAULT);
     layerLuoiKichThuoc = Lcad.DrwAddLayer(hDrw, "LuoiKichThuoc", "foreground", 0, Lcad.LC_LWEIGHT_DEFAULT);
     int hBlockModel = Lcad.PropGetHandle(hDrw, Lcad.LC_PROP_DRW_BLOCK_MODEL);
     foreach (LoKhoan value in danhSachLoKhoan)
     {
         int hEntCircle = Lcad.BlockAddCircle(hBlockModel, value.ToaDoX, value.ToaDoY, value.BanKinh, false);
         Lcad.PropPutInt(hEntCircle, Lcad.LC_PROP_ENT_ID, int.Parse(value.MaLoKhoan));
         Lcad.PropPutInt(hEntCircle, Lcad.LC_PROP_ENT_KEY, keyCircle);
         Lcad.PropPutStr(hEntCircle, Lcad.LC_PROP_ENT_LAYER, "LoMin");
         danhSachCircle.Add(new Circle(hEntCircle));
     }
     mgCircles.AddListCircle(danhSachCircle);
     if (banVeChinh.HienKhoangCach)
     {
         Lcad.LayerClear(layerLuoiKichThuoc, hBlockModel);
         DungLuoiKichThuoc();
     }
     //vẽ lại hình
     Lcad.DrwRegenViews(hDrw, 0);
     Lcad.WndExeCommand(hWnd, Lcad.LC_CMD_ZOOM_EXT, 0);
     BS_LiteCAD.ShowNotifyAutoHide(elementHost1, this.banVeChinh.TenBanVe + " - đã mở");
     //mở form dựng lưới lỗ khoan
     if(mgCircles.GetListCircles().Count == 0)
     {
         FormXayDungLoKhoan fm = new FormXayDungLoKhoan();
         fm.MyGetData = new FormXayDungLoKhoan.GetData(loadFile_FormXayDungLoKhoan);
         fm.Show();
     }          
 }
 //mở bản vẽ
 private void barButtonItem_OpenFile_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         //filename = Lcad.DgGetFileName(panelControl_hWnd.Handle, Lcad.LC_DG_SELFILE);
         OpenFileDialog filename = new OpenFileDialog();
         filename.Title = "Open file LiteCAD";
         filename.Filter = "Drawing liteCAD|*.lcd;*.dwg;*.dxf;*.shp|all file|*.*";
         if (filename.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             if (filename.FileName != "")
             {
                 this.hoChieuChinh = new HoChieu();
                 this.banVeChinh = new BanVe();
                 //this.banVeChinh.HienKhoangCach = false;
                 this.Text = "Bản vẽ: [" + filename.FileName + "]";
                 Lcad.DrwLoad(hDrw, filename.FileName, this.Handle, hWnd);
                 layerLoMin = Lcad.DrwAddLayer(hDrw, "LoMin", "cyan", 0, Lcad.LC_LWEIGHT_DEFAULT);
                 layerLuoiKichThuoc = Lcad.DrwAddLayer(hDrw, "LuoiKichThuoc", "foreground", 0, Lcad.LC_LWEIGHT_DEFAULT);
                 GetCirlcesFromAutocadFile();
                 Lcad.DrwRegenViews(hDrw, 0);
                 BS_LiteCAD.ShowNotifyAutoHide(elementHost1, "Bản vẽ sẵn sàng");
             }
         }
     }
     catch
     {
         BS_LiteCAD.ShowNotifyAutoHide(elementHost1, "Không hiển thị được bản vẽ");
     }
 }
 private void loadFile_FormBanVeMoi(String idHoChieu)
 {
     this.hoChieuChinh = BS_HoChieu.HoChieu(idHoChieu);
     this.banVeChinh = BS_BanVe.BanVe(this.hoChieuChinh.MaBanVe);                    
     mgCircles = new ManageCircle();
     //dựng bản vẽ mới
     this.Text = "Hộ chiếu: [" + this.hoChieuChinh.TenHoChieu + "]";
     Lcad.DrwLoad(hDrw, BS_Template.ChonTemplate(this.banVeChinh.Template).DuongDan, this.Handle, hWnd);
     layerLoMin = Lcad.DrwAddLayer(hDrw, "LoMin", "cyan", 0, Lcad.LC_LWEIGHT_DEFAULT);
     layerLuoiKichThuoc = Lcad.DrwAddLayer(hDrw, "LuoiKichThuoc", "foreground", 0, Lcad.LC_LWEIGHT_DEFAULT);
     //vẽ lại hình
     Lcad.DrwRegenViews(hDrw, 0);
     Lcad.WndExeCommand(hWnd, Lcad.LC_CMD_ZOOM_EXT, 0);
     //mở form dựng lưới lỗ khoan
     if (mgCircles.GetListCircles().Count == 0)
     {
         FormXayDungLoKhoan fm = new FormXayDungLoKhoan();
         fm.MyGetData = new FormXayDungLoKhoan.GetData(loadFile_FormXayDungLoKhoan);
         fm.Show();
     }
 }
 private void buttonInsert_Click(object sender, EventArgs e)
 {
     HoChieu inserted = new HoChieu();
     if (textBoxMaHoChieu2.Text != String.Empty) { inserted.MaHoChieu = textBoxMaHoChieu2.Text; }
     if (textBoxTenHoChieu2.Text != String.Empty) { inserted.TenHoChieu = textBoxTenHoChieu2.Text; }
     inserted.NgayLap = DateTime.Now.ToString();
     if (comboBox_CongTruong2.Text != String.Empty) { inserted.MaCongTruong = (comboBox_CongTruong2.SelectedItem as CongTruong).MaCongTruong; }
     if (comboBox_DatDa2.Text != String.Empty) { inserted.MaDatDa = (comboBox_DatDa2.SelectedItem as DatDa).MaDatDa; }
     if (comboBox_MayKhoan2.Text != String.Empty) { inserted.MaMayKhoan = (comboBox_MayKhoan2.SelectedItem as MayKhoan).MaMayKhoan; }
     if (comboBox_KipNo2.Text != String.Empty) { inserted.MaKipNo = (comboBox_KipNo2.SelectedItem as KipNo).MaKipNo; }
     if (comboBox_ThuocNo2.Text != String.Empty) { inserted.MaThuocNo = (comboBox_ThuocNo2.SelectedItem as ThuocNo).MaThuocNo; }
     if (comboBox_PhuongPhapNo2.Text != String.Empty) { inserted.MaPPNo = (comboBox_PhuongPhapNo2.SelectedItem as PhuongPhapNo).MaPPNo; }
     if (comboBox_PhuKien2.Text != String.Empty) { inserted.MaPhuKien = (comboBox_PhuKien2.SelectedItem as PhuKienNo).MaPhuKien; }
     if (comboBox_CapDo2.Text != String.Empty) { inserted.MaCapDo = (comboBox_CapDo2.SelectedItem as CapDoNo).MaCapDo; }
     inserted.HeSoKC = double.Parse(textBoxHeSoKC2.Text);
     inserted.ChieuCaoTang = double.Parse(textBoxChieuCaoTang2.Text);
     inserted.QuyMoDotNo = double.Parse(textBoxQuyMoDotNo2.Text);
     inserted.KichThuoc_X = double.Parse(textBoxKichThuoc_X2.Text);
     inserted.KichThuoc_Y = double.Parse(textBoxKichThuoc_Y2.Text);
     try
     {
         BS_HoChieu.ThemHoChieu(inserted);
     }
     catch (Exception exc)
     {
         MessageBox.Show("Lỗi - " + exc.Message);
     }
     ShowPanel(1);
     HienThiDuLieu_HoChieu();
 }
 /// <summary>
 /// Hàm thêm hộ chiếu
 /// </summary>
 /// <param name="value">hộ chiếu cần thêm</param>
 /// <returns>bool</returns>
 public static bool ThemHoChieu(HoChieu value)
 {
     String sql = "INSERT INTO HoChieu (MaBanVe, TenHoChieu, ChieuCaoTang, QuyMoDotNo, MaCongTruong, MaDatDa, MaMayKhoan, MaKipNo, MaThuocNo, MaPPNo, MaPhuKien, MaCapDo, NgayLap, HeSoKC, KichThuoc_X, KichThuoc_Y) VALUES ('" + value.MaBanVe + "', '" + value.TenHoChieu + "', '" + value.ChieuCaoTang + "', '" + value.QuyMoDotNo + "', '" + value.MaCongTruong + "', '" + value.MaDatDa + "', '" + value.MaMayKhoan + "', '" + value.MaKipNo + "', '" + value.MaThuocNo + "', '" + value.MaPPNo + "', '" + value.MaPhuKien + "', '" + value.MaCapDo + "', '" + value.NgayLap + "', '" + value.HeSoKC + "', '" + value.KichThuoc_X + "', '" + value.KichThuoc_Y + "')";
     Connection conn = new Connection();
     return conn.SetData(sql);
 }
 /// <summary>
 /// Hàm tạo hộ chiếu
 /// </summary>
 /// <param name="tenHoChieu">Tên hộ chiếu</param>
 /// <returns>ID hộ chiếu vừa tạo</returns>
 public static String TaoHoChieu(String idTemplate, String tenHoChieu)
 {
     Connection conn = new Connection();
     SQLiteDataReader dr;
     HoChieu hoChieuVuaTao = new HoChieu();
     bool flag = true;
     //kiểm tra tên hộ chiếu có trùng ko
     List<HoChieu> danhSachHoChieu = BS_HoChieu.DanhSachHoChieu();
     foreach (HoChieu value in danhSachHoChieu)
     {
         if (value.TenHoChieu == tenHoChieu)
         {
             flag = false; break;
         }
     }
     //nếu ko trùng => tạo hộ chiếu mới, trả về id hộ chiếu vừa tạo
     if (flag)
     {
         //tạo bản vẽ mới cho hộ chiếu
         String idBanVe = BS_BanVe.TaoBanVe(idTemplate, tenHoChieu);
         if (idBanVe == null)
         {
             return null;
         }
         else
         {
             String sql = "INSERT INTO HoChieu (MaBanVe, TenHoChieu, NgayLap) VALUES ('" + idBanVe + "', '" + tenHoChieu + "', '" + DateTime.Now.ToString() + "')";
             conn.SetData(sql);
             sql = "SELECT * FROM HoChieu WHERE TenHoChieu = '" + tenHoChieu + "'";
             dr = conn.GetData(sql);
             while (dr.Read())
             {
                 hoChieuVuaTao = new HoChieu(dr["MaHoChieu"].ToString(), dr["MaBanVe"].ToString(), dr["TenHoChieu"].ToString(), ((dr["ChieuCaoTang"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["ChieuCaoTang"])), ((dr["QuyMoDotNo"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["QuyMoDotNo"])), dr["MaCongTruong"].ToString(), dr["MaDatDa"].ToString(), dr["MaMayKhoan"].ToString(), dr["MaKipNo"].ToString(), dr["MaThuocNo"].ToString(), dr["MaPPNo"].ToString(), dr["MaPhuKien"].ToString(), dr["MaCapDo"].ToString(), dr["NgayLap"].ToString(), ((dr["HeSoKC"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["HeSoKC"])), ((dr["KichThuoc_X"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["KichThuoc_X"])), ((dr["KichThuoc_Y"].ToString() == String.Empty) ? -1 : Convert.ToDouble(dr["KichThuoc_Y"])));
             }
             return hoChieuVuaTao.MaHoChieu;
         }               
     }
     //nếu trùng => trả về null
     else
     {
         return null;
     }
 }
 /// <summary>
 /// Hàm cập nhật hộ chiếu
 /// </summary>
 /// <param name="value">hộ chiếu cần cập nhật</param>
 /// <returns>bool</returns>
 public static bool CapNhatHoChieu(HoChieu value)
 {
     String sql = "UPDATE HoChieu SET TenHoChieu = '" + value.TenHoChieu + "', ChieuCaoTang = '" + value.ChieuCaoTang + "', QuyMoDotNo ='" + value.QuyMoDotNo + "', MaCongTruong = '" + value.MaCongTruong + "', MaDatDa = '" + value.MaDatDa + "', MaMayKhoan = '" + value.MaMayKhoan + "', MaKipNo = '" + value.MaKipNo + "', MaThuocNo = '" + value.MaThuocNo + "', MaPPNo = '" + value.MaPPNo + "', MaPhuKien = '" + value.MaPhuKien + "', MaCapDo = '" + value.MaCapDo + "', NgayLap = '" + value.NgayLap + "', HeSoKC = '" + value.HeSoKC + "', KichThuoc_X = '" + value.KichThuoc_X + "', KichThuoc_Y = '" + value.KichThuoc_Y + "' WHERE MaHoChieu = '" + value.MaHoChieu + "'";
     Connection conn = new Connection();
     return conn.SetData(sql);
 }