private void UnhookTitleEvent(ucBase control) { if (control != null) { control.TitleChanged -= SetTitle; } }
private void HookTitleEvent(ucBase control) { SetTitle(control, EventArgs.Empty); if (control != null) { control.TitleChanged += SetTitle; } }
//what can we delete? public frmMain() { InitializeComponent(); LoadDB("k"); ucVendors = new ucVendors(cContext.Vendors.Local.ToBindingList(), EditProduct); ucProducts = new ucProducts(cContext.Products.Local.ToBindingList()); ucClients = new ucClients(cContext.Clients.Local.ToBindingList()); this.tabVendors.Controls.Add(this.ucVendors); this.tabProducts.Controls.Add(this.ucProducts); this.tabClients.Controls.Add(this.ucClients); frmDisplay = new frmUcDisplay(); //Vendor v = cContext.Vendors.Local[0]; //VendorProduct vp = new VendorProduct() { Quantity = 679 }; //vp.Product = cContext.Products.Local[1]; //v.VendorsProducts.Add(vp); //Vendor vq = cContext.Vendors.Local[1]; //VendorProduct vpq = new VendorProduct() { Quantity = 534 }; //vpq.Product = cContext.Products.Local[1]; //vq.VendorsProducts.Add(vpq); //Order o = cContext.Orders.Local[1]; //Item i = new Item() { Quantity = 7 }; //i.Product = cContext.Products.Local[1]; //o.Client = cContext.Clients.Local[0]; //o.Vendor = cContext.Vendors.Local[2]; //o.Items.Add(i); //cContext.Orders.Add(o); //Order o = new Order() { ClientName = "Alice", VendorName = "Bob" }; //Item i = new Item() { ProductName = "cupcacke", Quantity = 40 }; //Item ii = new Item() { ProductName = "bun", Quantity = 30 }; //o.Items.Add(i); //o.Items.Add(ii); //cContext.Orders.Add(o); cContext.SaveChanges(); //tabPaneMain.TabIndexChanged += TabPaneMain_TabIndexChanged; this.Load += FrmMain_Load; this.FormClosing += FrmMain_FormClosing; gvOrders.MasterRowExpanded += GvOrders_MasterRowExpanded; }
private void ShowUserControl(ucBase control) { //UnhookTitleEvent(_currentControl); dpUserControlContainer.Children.Clear(); if (control != null) { dpUserControlContainer.Children.Add(control); _currentControl = control; } //HookTitleEvent(_currentControl); }
private void SetTitle(object sender, EventArgs e) { ucBase uc = sender as ucBase; if (uc != null && !string.IsNullOrEmpty(uc.Title)) { this.Title = string.Format("{0}", uc.Title); } else { this.Title = "main Form"; } }
public static void AddTabControl(XtraTabControl tabParent, XtraUserControl ucName, string tabName, string tabCaption, frmMain frmMain = null) { //if (frmMain != null) //{ //event close view by delegate ucBase uc = (ucBase)ucName; uc.closeTab = frmMain.closeTabCurrent; //} //WaitDialogForm _wait = new WaitDialogForm("Đang tải dữ liệu ...", "Vui lòng đợi giây lát"); //// Test TabContol exists foreach (XtraTabPage _tab in tabParent.TabPages) { if (_tab.Name == tabName) { tabParent.SelectedTabPage = _tab; return; } } //if (clsParameter._goiThauID <= 0) //{ // _wait.Close(); // XtraMessageBox.Show("Vui lòng chọn gói thầu cần thao tác.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} //if (tabParent.TabPages.Count > 0) //tabParent.TabPages.RemoveAt(0); XtraTabPage _tabNew = new XtraTabPage(); _tabNew.Name = tabName; _tabNew.Text = tabCaption; _tabNew.VisibleChanged += new System.EventHandler(uc.tabPage_VisibleChanged); _tabNew.Controls.Add(ucName); ucName.Dock = DockStyle.Fill; _tabNew.Appearance.Header.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); _tabNew.Appearance.HeaderActive.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tabParent.TabPages.Add(_tabNew); tabParent.SelectedTabPage = _tabNew; //_wait.Close(); }
private void activityBFGridEX_LinkClicked(object sender, Janus.Windows.GridEX.ColumnActionEventArgs e) { try { if (e.Column.Key == "StepCode") { //FileForm().MoreInfo("activity", CurrentRow().ActivityId); //2017-08-11 JLL: More info did not work properly //was just selecting AC without selecting correct BF, or even displaying BF tab //fixed now with new MoreInfo methods on ucActivity ucBase ctl = FileForm().MoreInfo("activity"); ucActivity acCtl = (ucActivity)ctl; acCtl.MoreInfoBF("activity", CurrentRow().ActivityId, CurrentRow()); } } catch (Exception x) { UIHelper.HandleUIException(x); } }
/// <summary> /// Creates a new instance of the TabView class. /// </summary> /// <param name="uniqueIdentifier">A new create guid to identifier this view.</param> /// <param name="tabUserControl">The UserControl that should be added to the TabPage</param> /// <param name="tabIcon">The icon that should be used on the TabHeader.</param> public TabView(Guid uniqueIdentifier, ucBase tabUserControl, Image tabIcon = null) { UniqueIdentifier = uniqueIdentifier; TabUserControl = tabUserControl; TabIcon = tabIcon; }
private void event_ItemClick(object sender, ItemClickEventArgs e) { BarButtonItem item = e.Item as BarButtonItem; if (item != null) { ucBase uc = new ucBase(); switch (item.Name) { #region Danh mục case "btnTinh": uc = new ucDmTinh(); break; case "btnHuyen": uc = new ucDmHuyen(); break; case "btnXa": uc = new ucDmXa(); break; case "btnTrinhDoHocVan": uc = new ucDMTrinhDoHocVan(); break; case "btnTrinhDoChuyenMon": uc = new ucDMTrinhDoChuyenMon(); break; case "btnNgheNghiep": uc = new ucDMNgheNghiep(); break; case "btnTrinhDoNgoaiNgu": uc = new ucDMTrinhDoNgoaNgu(); break; case "btnDanToc": uc = new ucDMDanToc(); break; case "btnTonGiao": uc = new ucDMTonGiao(); break; case "btnChamSocBanThan": uc = new ucDMChamSocBanThan(); break; case "btnChucVuTrongHoi": uc = new ucDMChucVuHoi(); break; case "btnDungCuHoTro": uc = new ucDMDungCuHoTro(); break; case "btnNguyenNhanKT": uc = new ucDMNguyenNhanKhuyetTat(); break; case "btnTinhTrangKhuyetTat": uc = new ucDMTinhTrangKhuyetTat(); break; case "btnNhuCau": uc = new ucDMNhuCau(); break; case "btnThongTinNhaO": uc = new ucDMThongTinNhaO(); break; case "btnNKTSongVoiAi": uc = new ucDMNKTSongVoiAi(); break; case "btnNoiSinhSong": uc = new ucDMNoiSinhSong(); break; case "btnPhuongTienDiLai": uc = new ucDMPhuongTienDiLai(); break; case "btnThanhVienHoi": uc = new ucDMThanhVienHoi(); break; case "btnTinhTrangHonNhan": uc = new ucDMTinhTrangHonNhan(); break; case "btnDonViPhuTrach": uc = new ucDMTapHuan_DonViPhuTrach(); break; case "btnLoaiHoatDong": uc = new ucDMTapHuan_LoaiHoatDong(); break; case "btnLoaiNhaTaiTro": uc = new ucDMTapHuan_LoaiNhaTaiTro(); break; #endregion #region Lý lịch case "btnLyLich": uc = new ucLyLich(); break; case "btnDonGiaNhapHoi": rptBM_DonGiaNhapHoi rpt = new rptBM_DonGiaNhapHoi(); rpt.pLeftHeader.Value = clsParameter.pHospital; rpt.pParentLeftHeader.Value = clsParameter.pParentHospital; uc = new ucPrint(rpt); break; case "btnBMLyLich": rptLyLichHoiVien rptHoiVien = new rptLyLichHoiVien(); uc = new ucPrint(rptHoiVien); break; case "btnBCLyLich": uc = new ucBCLyLich(); break; #endregion #region Nâng cao năng lực case "btnTapHuan": uc = new ucHoatDongTapHuan2((Int64)CategoryTapHuan.TH_TAPHUAN); break; case "btnGiaoDuc": uc = new ucHoatDongTapHuan2((Int64)CategoryTapHuan.TH_GIAODUC); break; case "btnHuongDanThucTap": uc = new ucHoatDongTapHuan2((Int64)CategoryTapHuan.HUONG_DAN_THUC_TAP); break; case "btnVanDongChinhSach": uc = new ucHoatDongTapHuan2((Int64)CategoryTapHuan.VAN_DONG_CHINH_SACH); break; case "btnTruyenThongPhapLy": uc = new ucHoatDongTapHuan2((Int64)CategoryTapHuan.TRUYEN_THONG_PHAP_LY); break; #endregion #region Nâng cao nhận thức case "btnDaiHoi": uc = new ucHoatDongHoiThao((Int64)CategoryHoiThao.DAI_HOI); break; case "btnHoiNghi": uc = new ucHoatDongTapHuan2((Int64)CategoryTapHuan.HOI_NGHI); break; case "btnHoiThao": uc = new ucHoatDongTapHuan2((Int64)CategoryTapHuan.HOI_THAO); break; case "btnBuoiLe": uc = new ucHoatDongHoiThao((Int64)CategoryHoiThao.BUOI_LE); break; case "btnCuocHop": uc = new ucHoatDongHoiThao((Int64)CategoryHoiThao.CUOC_HOP); break; case "btnTruyenThongDaiChung": uc = new ucHoatDongHoiThao((Int64)CategoryHoiThao.TRUYEN_THONG_DAI_CHUNG); break; case "btnToChucSuKien": uc = new ucHoatDongHoiThao((Int64)CategoryHoiThao.TO_CHUC_SU_KIEN); break; case "btnToChucVanNghe": uc = new ucHoatDongHoiThao((Int64)CategoryHoiThao.TO_CHUC_VAN_NGHE); break; case "btnToChucTheThao": uc = new ucHoatDongHoiThao((Int64)CategoryHoiThao.TO_CHUC_THE_THAO); break; #endregion #region ASXH case "btnGiaiPhauChinhHinh": uc = new ucHoatDongASXH((Int64)CategoryASXH.GIAI_PHAU_CHINH_HINH); break; case "btnTangQua": uc = new ucHoatDongASXH((Int64)CategoryASXH.TANG_QUA); break; case "btnTangDungCuTroGiup": uc = new ucHoatDongASXH((Int64)CategoryASXH.TANG_DUNG_CU_TRO_GIUP); break; case "btnHocBong": uc = new ucHoatDongASXH((Int64)CategoryASXH.HOC_BONG); break; case "btnBHYT": uc = new ucHoatDongASXH((Int64)CategoryASXH.BHYT); break; case "btnHoTroHoiVienKK": uc = new ucHoatDongASXH((Int64)CategoryASXH.HO_TRO_HOI_VIEN_KHO_KHAN); break; case "btnThamVieng": uc = new ucHoatDongASXH((Int64)CategoryASXH.THAM_VIENG_HUU_SU); break; case "btnDamCuoi": uc = new ucHoatDongASXH((Int64)CategoryASXH.DAM_CUOI); break; case "btnCatNha": uc = new ucHoatDongASXH((Int64)CategoryASXH.CAT_NHA); break; case "btnSuaNha": uc = new ucHoatDongASXH((Int64)CategoryASXH.SUA_NHA); break; #endregion #region Hòa nhập xã hội case "btnGiaoLuu": uc = new ucHoatDongHNXH((Int64)CategoryHNXH.GIAO_LUU); break; case "btnLienHoan": uc = new ucHoatDongHNXH((Int64)CategoryHNXH.LIEN_HOAN); break; case "btnDonKhach": uc = new ucHoatDongHNXH((Int64)CategoryHNXH.DON_KHACH); break; case "btnThamQuanDuLich": uc = new ucHoatDongHNXH((Int64)CategoryHNXH.THAM_QUAN_DU_LICH); break; case "btnVanNghe": uc = new ucHoatDongHNXH((Int64)CategoryHNXH.VAN_NGHE); break; case "btnTheThao": uc = new ucHoatDongHNXH((Int64)CategoryHNXH.THE_THAO); break; case "btnLaodongCongIch": uc = new ucHoatDongHNXH((Int64)CategoryHNXH.LAO_DONG_CONG_ICH); break; #endregion #region Việc làm case "btnDayNghe": uc = new ucHoatDongDayNghe(); break; case "btnGioiThieuViecLam": uc = new ucHoatDongViecLam((Int64)CategoryViecLam.GIOI_THIEU_VIEC_LAM); break; case "btnGiaiQuyetViecLam": uc = new ucHoatDongViecLam((Int64)CategoryViecLam.GIAI_QUYET_VIEC_LAM); break; case "btnVayVon": uc = new ucHoatDongVayVon(); break; case "btnHoiChoTrienLam": uc = new ucHoatDongHoiChoTrienLam(); break; #endregion #region Báo cáo hội viên case "btnBCLyLichTheoDieuKien": uc = new ucBaoCaoHoiVienTheoDieuKien(); break; case "btnTongSoNKTTheoPhuong": uc = new ucBCHoiVienTongNKTTheoPhuong(); break; case "btnTongSoNKTTheoDangTat": uc = new ucBCHoiVienTongNKTTheoDangTat(); break; case "btnTongSoNKTCoViecLam": uc = new ucBCHoiVienTongNKTCoViecLam(); break; case "btnTongSoNKTTheoHocVan": uc = new ucBCHoiVienTongNKTTheoTrinhDoHocVan(); break; case "btnTongSoNamNu": uc = new ucBCHoiVienTongNKTTheoNamNu(); break; case "btnSoTreKTTu0_8": uc = new ucBCHoiVienTongNKTTheoTuoi(0, 8); break; case "btnSoTreKTTu6_18": uc = new ucBCHoiVienTongNKTTheoTuoi(6, 18); break; case "btnSoLuongNKTThamGiaHoatDong": uc = new ucBCHoiVienTongNKTThamGiaHoatDong(); break; case "btnSoLuongNKTNhanTCXH": uc = new ucBCHoiVienTongNKTTCXH(); break; case "btnPNKTCoGiaDinh": uc = new ucBCHoiVienTongNKTPhuNuCoGiaDinh(); break; case "btnBCTreKTVaConNKT": uc = new ucBCTreKTVaConNKT(); break; case "btnBCNhaTaiTroMTQ": uc = new ucBCNhaTaiTroVaMTQ(); break; #endregion #region Báo cáo hoạt động case "btnBCHoatDongTheoDieuKien": uc = new ucBCHoatDongTheoDieuKien(); break; case "btnBCHoatDongNangCaoNhanThuc": uc = new ucBCHoatDongNangCaoNhanThuc(); break; case "btnBCHoatDongAnSinhXaHoi": uc = new ucBCHoatDongASXH(); break; case "btnBCNangCaoNangLucVaVanDongCS": uc = new ucBCHoatDongNangCaoNangLucVaVanDonChinhSach(); break; case "btnBCHoatDongHNXH": uc = new ucBCHoatDongHoaNhapXaHoi(); break; case "btnBCHoatDongViecLam": uc = new ucBCHoatDongViecLam(); break; #endregion #region Hoạt động khác case "btnHoatDongKhac": uc = new ucHoatDongKhac(); break; case "btnBCHoatDongKhac": uc = new ucBCHoatDongKhac(); break; #endregion #region System case "btnSkin": uc = new ucSkin(); break; case "btnUser": uc = new ucUser(); break; case "btnThayDoiMatKhau": frmChangePass frm = new frmChangePass(); frm.ShowDialog(); return; case "btnNhatKy": uc = new ucNhatKy(); break; #endregion default: clsMessage.MessageWarning("Chức năng chưa được cấu hình"); return; } clsAddTab.AddTabControl(TabControlParent, uc, item.Name, item.Caption, this); } }