//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 gridViewMain_DoubleClick(object sender, EventArgs e) { ShowPanel(3); BanVe focusedRow = gridViewMain.GetFocusedRow() as BanVe; textBoxID.Text = focusedRow.ID; textBoxIDTemplate.Text = focusedRow.Template; textBoxTenBanVe.Text = focusedRow.TenBanVe; textBoxNgayChinhSua.Text = focusedRow.NgayChinhSua; textBoxDeltaX.Text = focusedRow.DeltaX.ToString(); textBoxDeltaY.Text = focusedRow.DeltaY.ToString(); textBoxNguoiDung.Text = focusedRow.NguoiDung; }
private void FormThongTinBanVe_Load(object sender, EventArgs e) { if (idHoChieu == null) { MessageBox.Show("Thông tin hộ chiếu chưa được lưu trong CSDL"); this.Close(); return; } BanVe value = BS_BanVe.BanVe(BS_HoChieu.HoChieu(idHoChieu).MaBanVe); labelValue_TenBanVe.Text = value.TenBanVe; labelValue_Template.Text = BS_Template.ChonTemplate(value.Template).TenTemplate; labelValue_NgayChinhSua.Text = value.NgayChinhSua; labelValue_SoLoKhoan.Text = BS_LoKhoan.DanhSachLoKhoan(idHoChieu).Count.ToString(); }
private void bt_DangNhap_Click(object sender, EventArgs e) { _connection = Connection.ConnectionData(); string sql = @"SELECT * FROM NhanVien"; _command = new SqlCommand(sql, _connection); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = _command; DataTable dt = new DataTable(); adapter.Fill(dt); _connection.Close(); string role = ""; for (int i = 0; i < dt.Rows.Count; i++) { if (tb_DangNhap.Text == "" || tb_MatKhau.Text == "") { MessageBox.Show("Vui lòng nhập tài khoản !"); return; } else if (tb_DangNhap.Text == dt.Rows[i][0].ToString() && tb_MatKhau.Text == dt.Rows[i][1].ToString()) { role = dt.Rows[i][2].ToString(); if (role == "Quản lý") { fQuanLy f = new fQuanLy(); f.Show(); this.Hide(); } else { BanVe f = new BanVe(); f.Show(); this.Hide(); } } } }
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 buttonUpdate_Click(object sender, EventArgs e) { BanVe updated = gridViewMain.GetFocusedRow() as BanVe; updated.Template = textBoxIDTemplate.Text; updated.TenBanVe = textBoxTenBanVe.Text; updated.NgayChinhSua = textBoxNgayChinhSua.Text; updated.DeltaX = double.Parse(textBoxDeltaX.Text); updated.DeltaY = double.Parse(textBoxDeltaY.Text); updated.NguoiDung = textBoxNguoiDung.Text; try { BS_BanVe.CapNhatBanVe(updated); } catch (Exception exc) { MessageBox.Show("Lỗi - " + exc.Message); } ShowPanel(1); HienThiDuLieu_BanVe(); }
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(); } }
public DataTable getTimKiemVe(BanVe bV) { Ultilies ultilies = new Ultilies(); return(ultilies.GetDataTimKiemVeCB(bV)); }
public bool XoaVeCB(BanVe bV) { Ultilies ultilies = new Ultilies(); return(ultilies.xoaBanVeCB(bV)); }
public bool SuaVeCB(BanVe bV) { Ultilies ultilies = new Ultilies(); return(ultilies.suaBanVeCB(bV)); }
public bool themVeCB(BanVe bV) { Ultilies ultilies = new Ultilies(); return(ultilies.themBanVeCB(bV)); }