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 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");
        }
示例#3
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            List <BanVe> dsXoa = new List <BanVe>();

            foreach (int value in gridViewMain.GetSelectedRows())
            {
                dsXoa.Add(gridViewMain.GetRow(value) as BanVe);
            }
            try
            {
                BS_BanVe.XoaBanVe(dsXoa);
            }
            catch (Exception exc)
            {
                MessageBox.Show("Lỗi - " + exc.Message);
            }
            HienThiDuLieu_BanVe();
        }
示例#4
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();
            }
        }
        private void panelMain_SizeChanged(object sender, EventArgs e)
        {
            panelMain.Controls.Clear();
            List <BanVe> danhSachBanVe = BS_BanVe.DanhSachBanVe();
            int          y = 0, i = 1;

            foreach (BanVe value in danhSachBanVe)
            {
                UserControl_BanVe controlBanVe = new UserControl_BanVe(value.TenBanVe, value.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);
            }
        }
示例#6
0
        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();
        }
示例#7
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);
            }
        }
示例#9
0
        private void HienThiDuLieu_BanVe()
        {
            List <BanVe> dsBanVe = BS_BanVe.DanhSachBanVe();

            gridControlMain.DataSource = dsBanVe;
        }
示例#10
0
 private void buttonPrint_Click(object sender, EventArgs e)
 {
     BS_Main.PrintData <BanVe>(BS_BanVe.DanhSachBanVe());
 }
示例#11
0
 private void buttonExport_Click(object sender, EventArgs e)
 {
     BS_Main.ExcelExport <BanVe>(BS_BanVe.DanhSachBanVe());
 }
        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();
            }
        }