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();
        }
示例#2
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();
            }
        }
示例#3
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();
     }
 }
        private void FormMoBanVeDatabase_Load(object sender, EventArgs e)
        {
            t.Start();
            List <HoChieu> danhSachHoChieu = BS_HoChieu.DanhSachHoChieu();
            int            y = 0, i = 1;

            foreach (HoChieu value in danhSachHoChieu)
            {
                UserControl_BanVe controlBanVe = new UserControl_BanVe(value.TenHoChieu, BS_BanVe.BanVe(value.MaBanVe).NgayChinhSua, i);
                controlBanVe.Width    = panelMain.Width;
                controlBanVe.Location = new Point(0, y);
                controlDanhSachBanVe.Add(controlBanVe);
                panelMain.Controls.Add(controlBanVe);
                y += 30; i++;
            }
            foreach (UserControl_BanVe value in controlDanhSachBanVe)
            {
                value.LinkLabelBanVe.Click += new System.EventHandler(controlDanhSachBanVe_Click);
            }
        }
        private void FormStart_Load(object sender, EventArgs e)
        {
            List <Template> danhSachTemplate = BS_Template.DanhSachTemplate();
            int             i = 1, x = 10, y = 10;

            foreach (Template value in danhSachTemplate)
            {
                RadioButton rbt = new RadioButton();
                rbt.Name       = value.ID;
                rbt.Location   = new Point(x, y);
                rbt.Appearance = System.Windows.Forms.Appearance.Button;
                rbt.Size       = new Size(160, 90);
                rbt.FlatStyle  = FlatStyle.Flat;
                rbt.FlatAppearance.BorderSize = 3;
                rbt.BackgroundImageLayout     = ImageLayout.Stretch;
                rbt.Text      = value.TenTemplate;
                rbt.ForeColor = Properties.Settings.Default.FormBackgroundColor;
                rbt.TextAlign = ContentAlignment.TopLeft;
                rbt.Cursor    = Cursors.Hand;
                if (!value.AnhMau.Equals(""))
                {
                    rbt.BackgroundImage = Image.FromFile(value.AnhMau);
                }
                radioButtonTemplate.Add(rbt);
                panelMain.Controls.Add(rbt);
                if (i % 2 == 0)
                {
                    x = 10; y = y + 100;
                }
                else
                {
                    x = x + 170;
                }
                i++;
            }
            foreach (RadioButton rb in radioButtonTemplate)
            {
                rb.FlatAppearance.BorderSize = 2;
                rb.CheckedChanged           += new System.EventHandler(radioButtonTempGroups_CheckedChanged);
            }

            danhSachHoChieu = BS_HoChieu.DanhSachHoChieuGanNhat(5);
            i = 0;
            foreach (HyperlinkLabelControl value in duongDanHoChieu)
            {
                if (danhSachHoChieu.Count > i)
                {
                    value.Text   = danhSachHoChieu[i].TenHoChieu;
                    value.Click += new System.EventHandler(link_Click);
                    i++;
                }
            }
            i = 0;
            foreach (Label value in ngayBanVe)
            {
                if (danhSachHoChieu.Count > i)
                {
                    value.Text = BS_BanVe.BanVe(danhSachHoChieu[i].MaBanVe).NgayChinhSua;
                    i++;
                }
                this.Refresh();
            }
        }