private void buttonUpdate_Click(object sender, EventArgs e) { LoKhoan updated = gridViewMain.GetFocusedRow() as LoKhoan; updated.BanKinh = double.Parse(textBoxBanKinh.Text); updated.ChieuSau = double.Parse(textBoxChieuSau.Text); updated.Lt = double.Parse(textBoxLt.Text); updated.Lkk = double.Parse(textBoxLkk.Text); updated.L0 = double.Parse(textBoxL0.Text); updated.Lbua = double.Parse(textBoxLbua.Text); if (comboBox_HuongKhoan.Text != String.Empty) { updated.HuongKhoan = comboBox_HuongKhoan.Text; } if (comboBox_MayKhoan.Text != String.Empty) { updated.MaMayKhoan = (comboBox_MayKhoan.SelectedValue as MayKhoan).MaMayKhoan; } try { BS_LoKhoan.CapNhatLoKhoan(updated); } catch (Exception exc) { MessageBox.Show("Lỗi - " + exc.Message); } ShowPanel(1); HienThiDuLieu_LoKhoan(); }
private void RefreshData(String _idLoKhoan) { LoKhoan loKhoan = BS_LoKhoan.ThongTinLoKhoan(idHoChieu, _idLoKhoan); //hiển thị thông tin labelValue_MaHoChieu.Text = BS_HoChieu.HoChieu(loKhoan.MaHoChieu).TenHoChieu; labelValue_MaBanVe.Text = loKhoan.MaBanVe; labelValue_MaMayKhoan.Text = BS_MayKhoan.MayKhoan(loKhoan.MaMayKhoan).TenMayKhoan; labelValue_MaLK.Text = loKhoan.MaLoKhoan; comboBox_MayKhoan.DataSource = BS_MayKhoan.DanhSachMayKhoan(); comboBox_MayKhoan.DisplayMember = "TenMayKhoan"; comboBox_MayKhoan.Text = BS_MayKhoan.MayKhoan(loKhoan.MaMayKhoan).TenMayKhoan; //hiển thị thông số labelValue_DuongKinh.Text = (Math.Round(loKhoan.BanKinh * 2, 2)).ToString(); textBox_DuongKinh.Text = (Math.Round(loKhoan.BanKinh * 2, 2)).ToString(); labelValue_ChieuSauLK.Text = (Math.Round(loKhoan.ChieuSau, 2)).ToString(); textBox_ChieuSauLK.Text = (Math.Round(loKhoan.ChieuSau, 2)).ToString(); labelValue_HuongKhoan.Text = comboBox_HuongKhoan.Text = loKhoan.HuongKhoan; labelValue_ToaDoX.Text = textBox_ToaDoX.Text = (Math.Round(loKhoan.ToaDoX, 2)).ToString(); labelValue_ToaDoY.Text = textBox_ToaDoY.Text = (Math.Round(loKhoan.ToaDoY, 2)).ToString(); labelValue_Lt.Text = textBox1.Text = loKhoan.Lt.ToString(); labelValue_Lkk.Text = textBox2.Text = loKhoan.Lkk.ToString(); labelValue_L0.Text = textBox3.Text = loKhoan.L0.ToString(); labelValue_Lbua.Text = textBox4.Text = loKhoan.Lbua.ToString(); }
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 FormLoKhoan_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; } if (BS_LoKhoan.ThongTinLoKhoan(idHoChieu, idLoKhoan).MaLoKhoan == null) { MessageBox.Show("Thông tin lỗ khoan chưa được lưu trong CSDL"); this.Close(); return; } ChangeView(false); }
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(); } }
private void buttonUpdate_Click(object sender, EventArgs e) { LoKhoan loKhoan = BS_LoKhoan.ThongTinLoKhoan(idHoChieu, (comboBox_MaLK.SelectedItem as LoKhoan).MaLoKhoan); if (comboBox_MayKhoan.SelectedItem != null) { loKhoan.MaMayKhoan = (comboBox_MayKhoan.SelectedItem as MayKhoan).MaMayKhoan; } loKhoan.BanKinh = double.Parse(textBox_DuongKinh.Text) / 2; loKhoan.ChieuSau = double.Parse(textBox_ChieuSauLK.Text); loKhoan.HuongKhoan = comboBox_HuongKhoan.Text; loKhoan.ToaDoX = double.Parse(textBox_ToaDoX.Text); loKhoan.ToaDoY = double.Parse(textBox_ToaDoY.Text); loKhoan.Lt = double.Parse(textBox1.Text); loKhoan.Lkk = double.Parse(textBox2.Text); loKhoan.L0 = double.Parse(textBox3.Text); loKhoan.Lbua = double.Parse(textBox4.Text); BS_LoKhoan.CapNhatLoKhoan(loKhoan); ChangeView(false); RefreshData((comboBox_MaLK.SelectedItem as LoKhoan).MaLoKhoan); }
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()); }