private void HienThiDuLieu_LoKhoan() { List <LoKhoan> dsLoKhoan = BS_LoKhoan.DanhSachLoKhoan(); gridControlMain.DataSource = dsLoKhoan; comboBox_MayKhoan.DataSource = BS_MayKhoan.DanhSachMayKhoan(); comboBox_MayKhoan.DisplayMember = "TenMayKhoan"; }
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 buttonUpdate_Click(object sender, EventArgs e) { List <LoKhoan> danhSachLoKhoan = BS_LoKhoan.DanhSachLoKhoan(idHoChieu); foreach (LoKhoan value in danhSachLoKhoan) { if (comboBox_MayKhoan.SelectedItem != null) { value.MaMayKhoan = (comboBox_MayKhoan.SelectedItem as MayKhoan).MaMayKhoan; } if (textBox_DuongKinh.Text != String.Empty) { value.BanKinh = double.Parse(textBox_DuongKinh.Text) / 2; } if (textBox_ChieuSauLK.Text != String.Empty) { value.ChieuSau = double.Parse(textBox_ChieuSauLK.Text); } if (comboBox_HuongKhoan.Text != String.Empty) { value.HuongKhoan = comboBox_HuongKhoan.Text; } if (textBox1.Text != String.Empty) { value.Lt = double.Parse(textBox1.Text); } if (textBox2.Text != String.Empty) { value.Lkk = double.Parse(textBox2.Text); } if (textBox3.Text != String.Empty) { value.L0 = double.Parse(textBox3.Text); } if (textBox4.Text != String.Empty) { value.Lbua = double.Parse(textBox4.Text); } } MyGetData(BS_LoKhoan.CapNhatLoKhoan(danhSachLoKhoan)); this.Close(); }
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(); } }
public FormLoKhoan(String _idHoChieu, String _idLoKhoan) { InitializeComponent(); //add text control textLabel.Add(labelTitle1); textLabel.Add(labelTitle2); textLabel.Add(label_MaBanVe); textLabel.Add(label_MaLK); textLabel.Add(label_MaHoChieu); textLabel.Add(label_MaMayKhoan); textLabel.Add(label_DuongKinh); textLabel.Add(label_ChieuSauLK); textLabel.Add(label_HuongKhoan); textLabel.Add(label_ToaDoX); textLabel.Add(label_ToaDoY); //add value control valueLabel.Add(labelValue_MaBanVe); valueLabel.Add(labelValue_MaLK); valueLabel.Add(labelValue_MaHoChieu); valueLabel.Add(labelValue_MaMayKhoan); valueLabel.Add(labelValue_DuongKinh); valueLabel.Add(labelValue_ChieuSauLK); valueLabel.Add(labelValue_HuongKhoan); valueLabel.Add(labelValue_ToaDoX); valueLabel.Add(labelValue_ToaDoY); valueTextBox.Add(textBox_DuongKinh); valueTextBox.Add(textBox_ChieuSauLK); valueTextBox.Add(textBox_ToaDoX); valueTextBox.Add(textBox_ToaDoY); valueTextBox.Add(textBox1); valueTextBox.Add(textBox2); valueTextBox.Add(textBox3); valueTextBox.Add(textBox4); //add combobox control valueComboBox.Add(comboBox_MayKhoan); valueComboBox.Add(comboBox_HuongKhoan); //add button control buttonGroup.Add(buttonBack); buttonGroup.Add(buttonEdit); buttonGroup.Add(buttonUpdate); idHoChieu = _idHoChieu; idLoKhoan = _idLoKhoan; foreach (TextBox tx in valueTextBox) { tx.KeyPress += textBoxInput_KeyPress; tx.TextChanged += textBox_TextChanged; } comboBox_MaLK.DataSource = BS_LoKhoan.DanhSachLoKhoan(idHoChieu); comboBox_MaLK.DisplayMember = "MaLoKhoan"; comboBox_MaLK.Text = (BS_LoKhoan.ThongTinLoKhoan(idHoChieu, idLoKhoan)).MaLoKhoan; //UI this.BackColor = Properties.Settings.Default.FormBackgroundColor; this.MinimizeBox = false; this.MaximizeBox = false; label1.BackColor = ColorTranslator.FromHtml("#58D13D"); label2.BackColor = ColorTranslator.FromHtml("#3DD1A2"); label3.BackColor = ColorTranslator.FromHtml("#3DBDD1"); label4.BackColor = ColorTranslator.FromHtml("#3D65D1"); 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; } }
private void buttonPrint_Click(object sender, EventArgs e) { BS_Main.PrintData <LoKhoan>(BS_LoKhoan.DanhSachLoKhoan()); }
private void buttonExport_Click(object sender, EventArgs e) { BS_Main.ExcelExport <LoKhoan>(BS_LoKhoan.DanhSachLoKhoan()); }