//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 buttonUpdate_Click(object sender, EventArgs e) { HoChieu updated = gridViewMain.GetFocusedRow() as HoChieu; if (textBoxTenHoChieu.Text != String.Empty) { updated.TenHoChieu = textBoxTenHoChieu.Text; } if (comboBox_CongTruong.Text != String.Empty) { updated.MaCongTruong = (comboBox_CongTruong.SelectedItem as CongTruong).MaCongTruong; } if (comboBox_DatDa.Text != String.Empty) { updated.MaDatDa = (comboBox_DatDa.SelectedItem as DatDa).MaDatDa; } if (comboBox_MayKhoan.Text != String.Empty) { updated.MaMayKhoan = (comboBox_MayKhoan.SelectedItem as MayKhoan).MaMayKhoan; } if (comboBox_KipNo.Text != String.Empty) { updated.MaKipNo = (comboBox_KipNo.SelectedItem as KipNo).MaKipNo; } if (comboBox_ThuocNo.Text != String.Empty) { updated.MaThuocNo = (comboBox_ThuocNo.SelectedItem as ThuocNo).MaThuocNo; } if (comboBox_PhuongPhapNo.Text != String.Empty) { updated.MaPPNo = (comboBox_PhuongPhapNo.SelectedItem as PhuongPhapNo).MaPPNo; } if (comboBox_PhuKien.Text != String.Empty) { updated.MaPhuKien = (comboBox_PhuKien.SelectedItem as PhuKienNo).MaPhuKien; } if (comboBox_CapDo.Text != String.Empty) { updated.MaCapDo = (comboBox_CapDo.SelectedItem as CapDoNo).MaCapDo; } updated.HeSoKC = double.Parse(textBoxHeSoKC.Text); updated.ChieuCaoTang = double.Parse(textBoxChieuCaoTang.Text); updated.QuyMoDotNo = double.Parse(textBoxQuyMoDotNo.Text); updated.KichThuoc_X = double.Parse(textBoxKichThuoc_X.Text); updated.KichThuoc_Y = double.Parse(textBoxKichThuoc_Y.Text); try { BS_HoChieu.CapNhatHoChieu(updated); } catch (Exception exc) { MessageBox.Show("Lỗi - " + exc.Message); } ShowPanel(1); HienThiDuLieu_HoChieu(); }
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(); } }
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 gridViewMain_DoubleClick(object sender, EventArgs e) { ShowPanel(3); HoChieu focusedRow = gridViewMain.GetFocusedRow() as HoChieu; textBoxMaBanVe.Text = focusedRow.MaBanVe; textBoxMaHoChieu.Text = focusedRow.MaHoChieu; textBoxTenHoChieu.Text = focusedRow.TenHoChieu; textBoxNgayLap.Text = focusedRow.NgayLap; comboBox_CongTruong.Text = BS_CongTruong.CongTruong(focusedRow.MaCongTruong).TenCongTruong; comboBox_DatDa.Text = BS_DatDa.DatDa(focusedRow.MaDatDa).TenDatDa; comboBox_MayKhoan.Text = BS_MayKhoan.MayKhoan(focusedRow.MaMayKhoan).TenMayKhoan; comboBox_KipNo.Text = BS_KipNo.KipNo(focusedRow.MaMayKhoan).TenKipNo; comboBox_ThuocNo.Text = BS_ThuocNo.ThuocNo(focusedRow.MaThuocNo).TenThuocNo; comboBox_PhuongPhapNo.Text = BS_PhuongPhapNo.PhuongPhapNo(focusedRow.MaPPNo).TenPPNo; comboBox_PhuKien.Text = BS_PhuKienNo.PhuKienNo(focusedRow.MaPhuKien).TenPhuKien; comboBox_CapDo.Text = BS_CapDoNo.CapDoNo(focusedRow.MaCapDo).TenCapDo; textBoxHeSoKC.Text = focusedRow.HeSoKC.ToString(); textBoxChieuCaoTang.Text = focusedRow.ChieuCaoTang.ToString(); textBoxQuyMoDotNo.Text = focusedRow.QuyMoDotNo.ToString(); textBoxKichThuoc_X.Text = focusedRow.KichThuoc_X.ToString(); textBoxKichThuoc_Y.Text = focusedRow.KichThuoc_Y.ToString(); //textBoxThoiDiemNo.Text = ...; }
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(); }