Ejemplo n.º 1
0
 private void RefreshData()
 {
     labelValue_MaHoChieu.Text       = BS_HoChieu.HoChieu(idHoChieu).TenHoChieu;
     comboBox_MayKhoan.DataSource    = BS_MayKhoan.DanhSachMayKhoan();
     comboBox_MayKhoan.DisplayMember = "TenMayKhoan";
     comboBox_MayKhoan.SelectedItem  = null;
 }
        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 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();
        }
Ejemplo n.º 4
0
        private void LuuHoChieu(String idHoChieu)
        {
            List <LoKhoan> danhSachLoKhoan = new List <LoKhoan>();

            GetCirlcesFromAutocadFile();
            List <Circle> danhSachCircle = mgCircles.GetListCircles();

            foreach (Circle value in danhSachCircle)
            {
                danhSachLoKhoan.Add(new LoKhoan(idHoChieu, value));
            }
            BS_HoChieu.LuuBanVe(danhSachLoKhoan, idHoChieu);
            //BS_BanVe.CapNhatDelta(BS_HoChieu.HoChieu(idHoChieu).MaBanVe, this.banVeChinh.DeltaX, this.banVeChinh.DeltaY);
            BS_BanVe.CapNhatBanVe(banVeChinh);
            BS_LiteCAD.ShowNotifyAutoHide(elementHost1, BS_HoChieu.HoChieu(idHoChieu).TenHoChieu + " - đã lưu");
        }
Ejemplo n.º 5
0
        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();
            }
        }
Ejemplo n.º 6
0
 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();
     }
 }