private void AddPanel(Screen screen) { switch (screen) { case Screen.Product: if (_UC_PRODUCT == null) _UC_PRODUCT = new UcDataProduct(); _USER_CONTROL = _UC_PRODUCT; break; case Screen.Claim: if (_UC_CLAIM == null) _UC_CLAIM = new UcClaim(); _USER_CONTROL = _UC_CLAIM; break; case Screen.StockMonitor: if (_UC_STOCK_MONITOR == null) _UC_STOCK_MONITOR = new UcStockMonitor(); _USER_CONTROL = _UC_STOCK_MONITOR; break; case Screen.Report: if (_UC_REPORT == null) _UC_REPORT = new UcReport(); _USER_CONTROL = _UC_REPORT; break; case Screen.Member: if (_UC_MEMBER == null) _UC_MEMBER = new UcMember(); _USER_CONTROL = _UC_MEMBER; break; } if (!pnlMain.Contains(_USER_CONTROL)) { pnlMain.Controls.Clear(); _USER_CONTROL.Dock = DockStyle.Fill; pnlMain.Controls.Add(_USER_CONTROL); } }
protected override object CreateControlCore() { XtraUserControl control = new XtraUserControl(); showRowGrandTotalCheckEdit = new CheckEdit(); showRowGrandTotalCheckEdit.Properties.Caption = "Show Row Grand Total"; // "显示列总数"; showRowGrandTotalCheckEdit.Location = new Point(0, 0); showRowGrandTotalCheckEdit.Size = showRowGrandTotalCheckEdit.CalcBestSize(); showRowGrandTotalCheckEdit.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top; showRowGrandTotalCheckEdit.CalcBestSize(); showRowGrandTotalCheckEdit.Enabled = false; showRowGrandTotalCheckEdit.CheckedChanged += new EventHandler(showRowGrandTotalCheckEdit_CheckedChanged); showColumnGrandTotalCheckEdit = new CheckEdit(); showColumnGrandTotalCheckEdit.Properties.Caption = "Show Column Grand Total";// "显示栏总数"; showColumnGrandTotalCheckEdit.Location = new Point(0, 20); showColumnGrandTotalCheckEdit.Size = showColumnGrandTotalCheckEdit.CalcBestSize(); showColumnGrandTotalCheckEdit.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top; showColumnGrandTotalCheckEdit.CalcBestSize(); showColumnGrandTotalCheckEdit.Enabled = false; showColumnGrandTotalCheckEdit.CheckedChanged += new EventHandler(showColumnGrandTotalCheckEdit_CheckedChanged); control.Controls.Add(showColumnGrandTotalCheckEdit); control.Controls.Add(showRowGrandTotalCheckEdit); control.Size = control.GetPreferredSize(new Size()); control.MaximumSize = new Size(0, control.Size.Height); control.MinimumSize = new Size(0, control.Size.Height); return control; }
public void AddTab(XtraUserControl userControl, string titleTab, bool newTab) { //estancia uma nova Tab passando os parametros XtraTabPage sysTabPage1 = new XtraTabPage(); // mostra o botao de fechamento da Tab if (userControl.Name.Equals("WaringsPaymentsDayForm")) sysTabPage1.ShowCloseButton = DefaultBoolean.False; else sysTabPage1.ShowCloseButton = DefaultBoolean.True; //informa qual o Control sysTabPage1.Controls.Add((Control)userControl); //informa o nome do Control para comparações futuras sysTabPage1.Tag = userControl.Name; //informa o titulo da Tab sysTabPage1.Text = titleTab; // Inteiro necessario para saber se o Control ja existe na Tab int num = 0; // estancia um nova Tab caso ja exista o Control informado anteriormente e vincula a esta para usar futuramente XtraTabPage sysTabPage2 = new XtraTabPage(); // verifica se ja existe foreach (XtraTabPage sysTabPage3 in desk.tabControl.TabPages) { // se existir vincula a Tab criada anteriormente, se nao existir nao faz nada if (sysTabPage3 == sysTabPage1 || sysTabPage3.Tag.Equals(sysTabPage1.Tag)) { ++num; sysTabPage2 = sysTabPage3; } } // se o Control nao existir na Tab vincula ela, e da foco if (num == 0) { desk.tabControl.TabPages.Add(sysTabPage1); desk.tabControl.SelectedTabPage = sysTabPage1; } // caso existir mas newTab esteja TRUE remeve a atual e vincula a nova else if (newTab) { desk.tabControl.TabPages.Remove(sysTabPage2); desk.tabControl.TabPages.Add(sysTabPage1); desk.tabControl.SelectedTabPage = sysTabPage1; } // se existir e nao deseja vincular nova, apenas da foco else desk.tabControl.SelectedTabPage = sysTabPage2; SplashScreenManager.CloseForm(false); }
public void CreateMDIControl(string strTitle, string strTag, XtraUserControl ctrl, Image image) { try { DevExpress.XtraTabbedMdi.XtraMdiTabPage currentPage = null; if (currentPage == null) { loading.ShowWaitForm(); MdiForm frm = new MdiForm(); frm.Visible = false; ctrl.Dock = DockStyle.Fill; frm.FormClosing += new FormClosingEventHandler(frm_FormClosing); frm.Text = strTitle; frm.Tag = strTag; ctrl.Tag = strTag; ctrl.Text = strTitle; if (!IsTabbedMdi) { frm.ClientSize = new Size(this.Width, this.Height); } frm.Controls.Add(ctrl); frm.MdiParent = this; if (image != null) { frm.ShowIcon = true; } else { image = base.Icon.ToBitmap(); } frm.Show(); currentPage = xtraTabbedMdiMgr.SelectedPage; } else { xtraTabbedMdiMgr.SelectedPage = currentPage; } if (currentPage != null && ctrl is ucIndex) { currentPage.ShowCloseButton = DefaultBoolean.False; } } catch (Exception ex) { loading.CloseWaitForm(); XtraMessageBox.Show(ex.Message); } finally { loading.CloseWaitForm(); LayoutMdi(); GC.Collect(); } }
void accordionControl_SelectedElementChanged(object sender, SelectedElementChangedEventArgs e) { if (e.Element == null) { return; } XtraUserControl userControl = e.Element.Text == "SQL格式调整" ? formatUserControl : parseLogUserControl; tabbedView.AddDocument(userControl); tabbedView.ActivateDocument(userControl); }
void RecreateUserControls(DocumentEventArgs e) { if (e.Document.Caption == "Employees") { employeesUserControl = CreateUserControl("Employees"); } else { customersUserControl = CreateUserControl("Customers"); } }
void RecreateUserControls(DocumentEventArgs e) { if (e.Document.Caption == "SQL格式调整") { formatUserControl = CreateUserControl("SQL格式调整"); } else { parseLogUserControl = CreateUserControl("SQL解析记录"); } }
void RecreateUserControls(DocumentEventArgs e) { if (e.Document.Caption == "FrequencySpectrum") { FrequencySpectrumUserControl = CreateUserControl("FrequencySpectrum"); } else { IQWaveformUserControl = CreateUserControl("IQWaveform"); } }
public MainForm() { this.StartPosition = FormStartPosition.CenterScreen; InitializeComponent(); formatUserControl = CreateUserControl("SQL格式调整"); parseLogUserControl = CreateUserControl("SQL解析记录"); accordionControl.SelectedElement = formatAccordionControlElement; _tokenizer = new BaiSqlFormatLib.Tokenizers.TSqlStandardTokenizer(); _parser = new BaiSqlFormatLib.Parsers.TSqlStandardParser(); if (Properties.Settings.Default.chkdefault) { ts_default.EditValue = true; txt_maxWidth.Enabled = false; chk_columnNotNewline.Enabled = false; chk_keywordAlign.Enabled = false; chk_conditionNewline.Enabled = false; chk_expandCase.Enabled = false; chk_expandBetween.Enabled = false; chk_expandIn.Enabled = false; chk_expandOn.Enabled = false; chk_uppercaseKeywords.Enabled = false; chk_allUpper.Enabled = false; chk_coloring.Enabled = false; chk_allIndent.Enabled = false; chk_asAlign.Enabled = false; txt_asMaxWidth.Enabled = false; } else { ts_custom.EditValue = true; } txt_maxWidth.Text = Properties.Settings.Default.MaxLineWidth.ToString(); chk_columnNotNewline.Checked = !Properties.Settings.Default.ExpandCommaLists; chk_keywordAlign.Checked = Properties.Settings.Default.KeywordAlign; chk_conditionNewline.Checked = Properties.Settings.Default.ExpandBooleanExpressions; chk_expandCase.Checked = Properties.Settings.Default.ExpandCaseStatements; chk_expandBetween.Checked = Properties.Settings.Default.ExpandBetweenConditions; chk_expandIn.Checked = Properties.Settings.Default.ExpandInLists; chk_expandOn.Checked = Properties.Settings.Default.BreakJoinOnSections; chk_uppercaseKeywords.Checked = Properties.Settings.Default.UppercaseKeywords; chk_allUpper.Checked = Properties.Settings.Default.AllUpper; chk_coloring.Checked = Properties.Settings.Default.HTMLColoring; chk_allIndent.Checked = Properties.Settings.Default.AllIndent; chk_asAlign.Checked = Properties.Settings.Default.AsAlign; txt_asMaxWidth.Text = Properties.Settings.Default.KeywordLengthOfAs.ToString(); SetFormatter(); _settingsLoaded = true; }
void accordionControl_SelectedElementChanged(object sender, SelectedElementChangedEventArgs e) { if (e.Element == null) { return; } XtraUserControl userControl = e.Element.Text == "Employees" ? employeesUserControl : customersUserControl; tabbedView.AddDocument(userControl); tabbedView.ActivateDocument(userControl); }
private void ShowUserControl(XtraUserControl userControl) { if (isBusy) { return; } ClearUserControl(); userControl.Dock = DockStyle.Fill; splitContainerControl.Panel2.Controls.Add(userControl); }
public void AddorShowTabPage(string Caption, XtraUserControl control, string Tag = null) { Tag = string.IsNullOrEmpty(Tag) ? Caption : Tag; if (IsExsitTabPage(Tag)) { ShowTabPage(Tag); } else { AddTabPage(Caption, control, Tag); } }
private void RenderSubControl(XtraUserControl control) { if (panelContainer.Controls.Count > 0) { panelContainer.Controls[0].Dispose(); panelContainer.Controls.Clear(); GC.Collect(); GC.WaitForPendingFinalizers(); } panelContainer.Controls.Add(control); control.Dock = DockStyle.Fill; }
private void WaterFallBtn_ItemClick(object sender, ItemClickEventArgs e) { XtraUserControl userControl = WaterfallPlotUserControl; tabbedView.AddDocument(userControl); tabbedView.ActivateDocument(userControl); m_UI_WaterfallPlot = new UI_WaterfallPlot(); this.WaterfallPlotUserControl.Controls.Clear(); this.WaterfallPlotUserControl.Controls.Add(m_UI_WaterfallPlot); this.m_UI_WaterfallPlot.Dock = DockStyle.Fill; }
private void IQWaveformBtn_ItemClick(object sender, ItemClickEventArgs e) { XtraUserControl userControl = IQWaveformUserControl; tabbedView.AddDocument(userControl); tabbedView.ActivateDocument(userControl); m_UI_IQWaveform = new UI_IQWaveform(); this.IQWaveformUserControl.Controls.Clear(); this.IQWaveformUserControl.Controls.Add(m_UI_IQWaveform); this.m_UI_IQWaveform.Dock = DockStyle.Fill; }
public XtraUserControl getControlByGuid(Guid guid) { foreach (IVisualPlugin plugin in _plugins.Values) { XtraUserControl control = plugin.getControlByGuid(guid); if (control != null) { return(control); } } return(null); }
private void FrequencySpectrumBtn_ItemClick(object sender, ItemClickEventArgs e) { XtraUserControl userControl = FrequencySpectrumUserControl; tabbedView.AddDocument(userControl); tabbedView.ActivateDocument(userControl); m_UI_FrequencySpectrum = new UI_FrequencySpectrum(); this.FrequencySpectrumUserControl.Controls.Clear(); this.FrequencySpectrumUserControl.Controls.Add(m_UI_FrequencySpectrum); this.m_UI_FrequencySpectrum.Dock = DockStyle.Fill; }
private void AddPanel(Screen screen) { switch (screen) { case Screen.Product: if (_UC_PRODUCT == null) { _UC_PRODUCT = new UcDataProduct(); } _USER_CONTROL = _UC_PRODUCT; break; case Screen.Claim: if (_UC_CLAIM == null) { _UC_CLAIM = new UcClaim(); } _USER_CONTROL = _UC_CLAIM; break; case Screen.StockMonitor: if (_UC_STOCK_MONITOR == null) { _UC_STOCK_MONITOR = new UcStockMonitor(); } _USER_CONTROL = _UC_STOCK_MONITOR; break; case Screen.Report: if (_UC_REPORT == null) { _UC_REPORT = new UcReport(); } _USER_CONTROL = _UC_REPORT; break; case Screen.Member: if (_UC_MEMBER == null) { _UC_MEMBER = new UcMember(); } _USER_CONTROL = _UC_MEMBER; break; } if (!pnlMain.Contains(_USER_CONTROL)) { pnlMain.Controls.Clear(); _USER_CONTROL.Dock = DockStyle.Fill; pnlMain.Controls.Add(_USER_CONTROL); } }
/// <summary> /// 탭 페이지 셋팅 /// </summary> /// <param name="assem">Assembly</param> /// <param name="classType">Class</param> /// <param name="control">컨트롤</param> private void SetTabPage(Assembly assem, Type classType, object control) { XtraTabPage xtraTabPage = new XtraTabPage(); string tabPageName = "tap_" + DateTime.Now.ToString("yyyyMMddHHmmssfffff"); xtraTabPage.Name = tabPageName; if (txtTabName.Text.Trim().Equals(string.Empty)) { xtraTabPage.Text = classType.FullName; } else { xtraTabPage.Text = txtTabName.Text; } xtraTabControl1.TabPages.Add(xtraTabPage); xtraTabControl1.SelectedTabPage = xtraTabPage; switch (control.GetType().BaseType.Name) { case "UserControl": UserControl usercontrol = control as UserControl; usercontrol.Dock = DockStyle.Fill; usercontrol.Name = "UC_" + classType.Name; xtraTabPage.Controls.Add(usercontrol); break; case "XtraUserControl": XtraUserControl xtraUserControl = control as XtraUserControl; xtraUserControl.Dock = DockStyle.Fill; xtraUserControl.Name = "XUC_" + classType.Name; xtraTabPage.Controls.Add(xtraUserControl); break; case "XtraForm": XtraForm xtraForm = control as XtraForm; xtraForm.Show(); break; case "Form": Form form = control as Form; form.Show(); break; default: UserControl defaultUserControl = control as UserControl; defaultUserControl.Dock = DockStyle.Fill; defaultUserControl.Name = "DUC_" + classType.Name; xtraTabPage.Controls.Add(defaultUserControl); break; } }
public MainForm() { InitializeComponent(); employeesUserControl = CreateUserControl("Employees"); customersUserControl = CreateUserControl("Customers"); productionPlanUserControl = CreateUserControl(AppSettings.PRODUCTION_PLAN); labelProductionInfoUserControl = CreateUserControl(AppSettings.LABEL_PRODUCTION_INFO); historicalProductionUserControl = CreateUserControl(AppSettings.HISTORICAL_PRODUCTION); userInfoUserControl = CreateUserControl(AppSettings.USER_INFO); stationInfoUserControl = CreateUserControl(AppSettings.STATION_INFO); accordionControl.SelectedElement = ele_ProductionPlan; }
public DataUiViewer(XtraUserControl viewControl) { InitializeComponent(); viewControl.Dock = DockStyle.Fill; Controls.Add(viewControl); var ret1 = FindControlRecursive(viewControl, "btOk"); if (ret1 != null) AcceptButton = (IButtonControl)ret1; var ret2 = FindControlRecursive(viewControl, "btCancel"); if (ret2 != null) CancelButton = (IButtonControl)ret2; }
public static void ShowUserControl(this PanelControl pnl, XtraUserControl type) { //if(pnl.Controls[type.] == type) if (pnl.Controls[type.Name] is XtraUserControl userControl) { type.BringToFront(); } else { pnl.Controls.Add(type); type.BringToFront(); } }
private void btnALL_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { try { WindowsUIButton btn = e.Button as WindowsUIButton; XtraUserControl ctl = new XtraUserControl(); switch (btn.Tag.ToString()) { case "luu": { if (!dxValidationProvider1.Validate()) { return; } if (bKiemTrung()) { return; } Commons.Modules.sId = SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spUpdateLOAI_CONG_VIEC", (AddEdit ? -1 : Id), TEN_LCVTextEdit.EditValue, TEN_LCV_ATextEdit.EditValue, TEN_LCV_HTextEdit.EditValue, DOC_HAICheckEdit.EditValue, (PHEP_CTTextEdit.EditValue == null) ? 0 : PHEP_CTTextEdit.EditValue, ID_LTSearchLookUpEdit.EditValue ).ToString(); if (AddEdit) { if (XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgThemThanhCongBanMuonThemTiep"), "", MessageBoxButtons.YesNo) == DialogResult.Yes) { LoadTextNull(); return; } } this.DialogResult = DialogResult.OK; this.Close(); break; } case "huy": { this.Close(); break; } default: break; } } catch (Exception EX) { XtraMessageBox.Show(EX.Message.ToString()); } }
public static void OpenInputForm(XtraUserControl uc, Size size) { frmOpen frm = new frmOpen(); frm.Text = LanguageEngine.GetOpenFormText(uc.Name, ConfigEngine.Language); frm.Size = size; frm.MaximumSize = size; frm.MinimumSize = size; frm.Controls.Clear(); uc.Dock = DockStyle.Fill; frm.Controls.Add(uc); uc.Show(); frm.ShowDialog(); }
private void LoadUac(XtraUserControl uac) { if (checkfameexits(uac.Name).Tag != null) { navigationFrame1.SelectedPage = checkfameexits(uac.Name); return; } uac.Dock = DockStyle.Fill; NavigationPage page = new NavigationPage(); page.Tag = uac.Name; page.Controls.Add(uac); navigationFrame1.Pages.Add(page); navigationFrame1.SelectedPage = page; }
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 windowsUIButton_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e) { WindowsUIButton btn = e.Button as WindowsUIButton; XtraUserControl ctl = new XtraUserControl(); switch (btn.Tag.ToString()) { case "sua": { Bindingdata(true); enableButon(false); break; } case "xoa": { DeleteData(); break; } case "luu": { SaveData(); enableButon(true); Bindingdata(false); break; } case "khongluu": { enableButon(true); Bindingdata(false); break; } case "thoat": { if (XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgBanCoMuonThoatChuongtrinh"), Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTieuDeThoat"), MessageBoxButtons.YesNo) == DialogResult.No) { return; } this.Close(); break; } default: break; } }
private void btnALL_ButtonClick(object sender, ButtonEventArgs e) { try { WindowsUIButton btn = e.Button as WindowsUIButton; XtraUserControl ctl = new XtraUserControl(); switch (btn.Tag.ToString()) { case "luu": { if (!dxValidationProvider1.Validate()) { return; } if (bKiemTrung()) { return; } Commons.Modules.sId = SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spUpdateLUONG_TOI_THIEU", (AddEdit ? -1 : Id), NGAY_QDDateEdit.EditValue, ID_DVSearchLookUpEdit.EditValue, (LUONG_TOI_THIEUTextEdit.EditValue == null) ? 0 : LUONG_TOI_THIEUTextEdit.EditValue, (LUONG_TOI_THIEU_NNTextEdit.EditValue == null) ? 0 : LUONG_TOI_THIEU_NNTextEdit.EditValue, (BHXH_CNTextEdit.EditValue == null) ? 0 : BHXH_CNTextEdit.EditValue, (BHYT_CNTextEdit.EditValue == null) ? 0 : BHYT_CNTextEdit.EditValue, (BHTN_CNTextEdit.EditValue == null) ? 0 : BHTN_CNTextEdit.EditValue, (BHXH_CTTextEdit.EditValue == null) ? 0 : BHXH_CTTextEdit.EditValue, (BHYT_CTTextEdit.EditValue == null) ? 0 : BHYT_CTTextEdit.EditValue, (BHTN_CTTextEdit.EditValue == null) ? 0 : BHTN_CTTextEdit.EditValue ).ToString(); this.DialogResult = DialogResult.OK; this.Close(); break; } case "huy": { this.Close(); break; } default: break; } } catch (Exception EX) { XtraMessageBox.Show(EX.Message.ToString()); } }
XtraUserControl GetUserControl(string caption) { XtraUserControl userControl = new XtraUserControl(); userControl.Name = caption; userControl.BackColor = Color.FromArgb(r.Next(0, 255), r.Next(0, 255), r.Next(0, 255)); TextEdit edit = new TextEdit() { Dock = DockStyle.Top, Parent = userControl, Text = caption }; return(userControl); }
void InitLunchBreakControl() { if (_currentControl == null || !(_currentControl is UCLunchBrakes)) { ReleaseControl(); ClearListEstimationYears(); // may be not need ucLucnchBrk = new UCLunchBrakes(); ucLucnchBrk.Parent = pcClient; ucLucnchBrk.Dock = DockStyle.Fill; ucLucnchBrk.Show(); ucLucnchBrk.Entity = Entity; _currentControl = ucLucnchBrk; CreateBarControl(); } }
void InitUnavoidableAdditionalHoursControl() { if (_currentControl == null || !(_currentControl is UCUnavoidableAddHours)) { ReleaseControl(); ClearListEstimationYears(); ucUnAdHours = new UCUnavoidableAddHours(); ucUnAdHours.Parent = pcClient; ucUnAdHours.Dock = DockStyle.Fill; ucUnAdHours.Show(); ucUnAdHours.Entity = Entity; _currentControl = ucUnAdHours; CreateBarControl(); } }
public static void OpenInputForm(XtraUserControl uc, string vnTitle, string enTitle, Size size) { string languageID = new Configuration().Language; frmOpen frm = new frmOpen(); frm.Text = (languageID.Equals("vi-VN")) ? vnTitle : enTitle; frm.Size = size; frm.MaximumSize = size; frm.MinimumSize = size; frm.Controls.Clear(); uc.Dock = DockStyle.Fill; frm.Controls.Add(uc); uc.Show(); frm.ShowDialog(); }
private void btnALL_ButtonClick(object sender, ButtonEventArgs e) { try { WindowsUIButton btn = e.Button as WindowsUIButton; XtraUserControl ctl = new XtraUserControl(); switch (btn.Tag.ToString()) { case "luu": { if (!dxValidationProvider1.Validate()) { return; } if (bKiemTrung()) { return; } Commons.Modules.sId = SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spUpdateLOAI_HDLD", (bAddEditLHD ? -1 : iIdLHD), TEN_LHDLDTextEdit.EditValue, TEN_LHDLD_ATextEdit.EditValue, TEN_LHDLD_HTextEdit.EditValue, SO_THANGTextEdit.EditValue).ToString(); if (bAddEditLHD) { if (XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgThemThanhCongBanMuonThemTiep"), "", MessageBoxButtons.YesNo) == DialogResult.Yes) { LoadTextNull(); return; } } this.DialogResult = DialogResult.OK; this.Close(); break; } case "huy": { this.Close(); break; } default: break; } } catch (Exception EX) { XtraMessageBox.Show(EX.Message.ToString()); } }
/// <summary> /// Run User Control /// </summary> /// <param name="userControl"></param> /// <param name="oContainerPanel"></param> public static void RunUserControl(XtraUserControl userControl, XtraPanel oContainerPanel) { if (CommonUserControl == null) { CommonUserControl = userControl; AddCotrolToPanel(oContainerPanel, CommonUserControl, typeof(XtraUserControl)); } else { if (CommonUserControl.GetType() != userControl.GetType()) { CommonUserControl = userControl; AddCotrolToPanel(oContainerPanel, CommonUserControl, typeof(XtraUserControl)); } } }
public frmCategoryDialog(XtraUserControl control, string Caption, Size? size) { InitializeComponent(); if (Caption != null) this.Text = Caption; if (size != null) this.Size = size.Value; this.panelControl1.Controls.Add(control); control.Dock = DockStyle.Fill; this.cat = (IPluginCategory)control; if (control is DMTreeGroup) this.ThemCon.Visible = true; if (control is IActionCategory) ((IActionCategory)this.cat).GetMenuAction().Visible = false; this.ThemCon.Image = FWImageDic.ADD_CHILD_IMAGE16; this.btnThem.Image = FWImageDic.ADD_IMAGE16; this.btnXoa.Image = FWImageDic.DELETE_IMAGE16; this.btnSua.Image = FWImageDic.EDIT_IMAGE16; this.btnLuu.Image = FWImageDic.SAVE_IMAGE16; this.btnKhongLuu.Image = FWImageDic.NO_SAVE_IMAGE16; this.btnClose.Image = FWImageDic.CLOSE_IMAGE16; }
public static DelegationLib.DefinePermission GetPermission(XtraUserControl DM, String feature) { if (DMPermission == DanhMucPermType.READ_EDIT_COMMIT) { return HelpPermission.CategoryPermissionReadEditCommit(DM, feature); } else if (DMPermission == DanhMucPermType.READ_ADD_DELETE_EDIT) { return HelpPermission.CategoryPermission(DM, feature); } else if (DMPermission == DanhMucPermType.READ_EDIT) { return HelpPermission.CategoryPermissionReadEdit(DM, feature); } else { return null; } }
public static DelegationLib.DefinePermission CategoryPermission(XtraUserControl DanhMuc, string mainFeature) { #region DMGrid if (DanhMuc is DMGrid) { DMGrid basic = (DMGrid)DanhMuc; return delegate(object formCategory) { List<Object> items = new List<Object>(); ApplyPermissionAction.ApplyPermissionObject(items, basic, new PermissionItem(mainFeature, PermissionType.VIEW)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnAdd, new PermissionItem(mainFeature, PermissionType.ADD)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnDel, new PermissionItem(mainFeature, PermissionType.DELETE)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnUpdate, new PermissionItem(mainFeature, PermissionType.EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnSave, new PermissionItem(mainFeature, PermissionType.ADD_EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnNoSave, new PermissionItem(mainFeature, PermissionType.ADD_EDIT)); return items; }; } #endregion #region DMTreeGroup else if (DanhMuc is DMTreeGroup) { DMTreeGroup basic = (DMTreeGroup)DanhMuc; return delegate(object formCategory) { List<Object> items = new List<Object>(); ApplyPermissionAction.ApplyPermissionObject(items, basic, new PermissionItem(mainFeature, PermissionType.VIEW)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnAdd, new PermissionItem(mainFeature, PermissionType.ADD)); ApplyPermissionAction.ApplyPermissionObject(items, basic.addSameLevel, new PermissionItem(mainFeature, PermissionType.ADD)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnDel, new PermissionItem(mainFeature, PermissionType.DELETE)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnUpdate, new PermissionItem(mainFeature, PermissionType.EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnLuu, new PermissionItem(mainFeature, PermissionType.ADD_EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnKhongLuu, new PermissionItem(mainFeature, PermissionType.ADD_EDIT)); return items; }; } #endregion #region DMTreeGroupElement else if (DanhMuc is DMTreeGroupElement) { DMTreeGroupElement basic = (DMTreeGroupElement)DanhMuc; return delegate(object formCategory) { List<Object> items = new List<Object>(); ApplyPermissionAction.ApplyPermissionObject(items, basic, new PermissionItem(mainFeature, PermissionType.VIEW)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnAdd, new PermissionItem(mainFeature, PermissionType.ADD)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnDel, new PermissionItem(mainFeature, PermissionType.DELETE)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnUpdate, new PermissionItem(mainFeature, PermissionType.EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnSave, new PermissionItem(mainFeature, PermissionType.ADD_EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnNoSave, new PermissionItem(mainFeature, PermissionType.ADD_EDIT)); return items; }; } #endregion PLMessageBoxDev.ShowMessage("Loại danh mục mới " + DanhMuc.GetType().Name + " chưa được hỗ trợ"); return null; }
/// <summary>Cập nhập giao diện ứng với phân quyền của control /// True : Cho phép hiện thị control đó /// False: Không cho phép hiển thị control đó /// </summary> public static bool CheckCtrl(XtraUserControl control) { if (FrameworkParams.isPermision == null) return true; try { if (control is IPermisionable) { IPermisionable per = (IPermisionable)control; List<Object> objs = per.GetObjectItems(); if (objs != null) { ApplyPermissionAction a = new ApplyPermissionAction(null); //Cập nhật control tương ứng phân quyền bool flag = true; for (int i = 0; i < objs.Count; i++) { flag = flag && a.applyElement(objs[i], null); //if (objs[i] != control) // flag = flag && a.applyElement(objs[i], null); //else //{ // if (a.applyElement(objs[i], null) == false) // return false; //} } if (flag == true) { if (control is DMGrid) //Trường hợp đặc biệt nên bỏ sự kiện double click { DMGrid c = (DMGrid)control; c.BasicTemplate.SupportDoubleClick = c.btnUpdate.Visible; } else if (control is DMTreeGroupElement) { DMTreeGroupElement c = (DMTreeGroupElement)control; c._IsDrapDrop = c.btnUpdate.Visible; } //return true; return control.Visible; } return false; } } } catch (Exception ex) { PLException.AddException(ex); PLMessageBoxDev.ShowMessage("Lỗi cấu hình phân quyền"); return false; } return true; }
public static DelegationLib.DefinePermission GetPermission(XtraUserControl control, String feature, String description) { return HelpPermission.CategoryPermission(control, feature, description); }
void LoadUserControl(XtraUserControl userControl) { userControl.Dock = DockStyle.Fill; spl.Panel2.Controls.Clear(); spl.Panel2.Controls.Add(userControl); }
//PHUOCNC Hiện tại thực hiện 2 lần khi chuyển TabPage private void UpdateSearchControl(XtraUserControl ctl) { this.splitContainerControl1.Panel2.Controls.Clear(); this.splitContainerControl1.Panel2.Controls.Add(ctl); this.dockPanel1.Width = ctl.Width + 12; this.splitContainerControl1.SplitterPosition = splitContainerControl1.Height - ctl.Height - 6; this.panelControl1.Visible = true; ProtocolVN.Framework.Win.ProtocolForm.pl_ctrl_wrapper(this, ctl, true); ctl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); }
public static void OpenForm(frmMain index, XtraUserControl uc, string vnTitle, string enTitle, XtraTabbedMdiManager tabMain) { string languageID = new Configuration().Language; bool found = false; foreach (XtraForm frm in index.MdiChildren) { if (frm.Text.Equals((languageID.Equals("vi-VN")) ? vnTitle : enTitle)) { found = true; break; } } if (found) { foreach (XtraMdiTabPage tab in tabMain.Pages) { if (tab.Text.Equals((languageID.Equals("vi-VN")) ? vnTitle : enTitle)) { tabMain.SelectedPage = tab; break; } } } else { XtraForm frm = new XtraForm(); frm.Text = (languageID.Equals("vi-VN")) ? vnTitle : enTitle; frm.MdiParent = index; uc.Dock = DockStyle.Fill; frm.Controls.Clear(); frm.Controls.Add(uc); frm.Show(); } }
public static void OpenForm(frmMain index, XtraUserControl uc, string name) { XtraForm frm = new XtraForm(); frm.Text = name; frm.MdiParent = index; uc.Dock = DockStyle.Fill; frm.Controls.Clear(); frm.Controls.Add(uc); frm.Show(); }
public void SwitchBarPanel(XtraUserControl formCurrent) { if (formCurrent is JournalMainPanel) { ribbonControlMain.SelectedPage = ribbonPageJournal; } else if (formCurrent is UslugiPanelControl) { ribbonControlMain.SelectedPage = ribbonPageUslugi; } else if (formCurrent is StatisticMainPanel) { ribbonControlMain.SelectedPage = ribbonPageStatistic; } else if (formCurrent is ReportMainPanel) { ribbonControlMain.SelectedPage = ribbonPageRaport; } else if (formCurrent is ClientMainPanel) { ribbonControlMain.SelectedPage = ribbonPageClient; } }
public static DelegationLib.DefinePermission GetPermission(XtraUserControl control, String feature, String description) { return DanhMucPermission.GetPermission(control, feature, description); }
private void ShowNavigationControl(XtraUserControl userControl) { ClearNavigation(); userControl.Dock = DockStyle.Fill; splitContainerControl.Panel1.Controls.Add(userControl); }
public static DelegationLib.DefinePermission CategoryPermission(XtraUserControl DanhMuc, string mainFeature, string description) { Permission per = new Permission(mainFeature, description); if (DanhMuc is PLDMGrid) { PLDMGrid basic1 = (PLDMGrid)DanhMuc; DMGrid basic = basic1.GetDMGrid; return delegate(object formCategory) { List<Object> items = new List<Object>(); //Lap vo tan xem lai tai sao ??? ApplyPermissionAction.ApplyPermissionObject(items, basic, per.GetPermissionItem(PermissionType.VIEW)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnAdd, per.GetPermissionItem(PermissionType.ADD)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnDel, per.GetPermissionItem(PermissionType.DELETE)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnUpdate, per.GetPermissionItem(PermissionType.EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnSave, per.GetPermissionItem(PermissionType.ADD_EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnNoSave, per.GetPermissionItem(PermissionType.ADD_EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnSelect, per.GetPermissionItem(PermissionType.VIEW)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnNoSelect, per.GetPermissionItem(PermissionType.VIEW)); return items; }; } #region DMGrid else if (DanhMuc is DMGrid) { DMGrid basic = (DMGrid)DanhMuc; return delegate(object formCategory) { List<Object> items = new List<Object>(); ApplyPermissionAction.ApplyPermissionObject(items, basic, per.GetPermissionItem(PermissionType.VIEW)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnAdd, per.GetPermissionItem(PermissionType.ADD)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnDel, per.GetPermissionItem(PermissionType.DELETE)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnUpdate, per.GetPermissionItem(PermissionType.EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnSave, per.GetPermissionItem(PermissionType.ADD_EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnNoSave, per.GetPermissionItem(PermissionType.ADD_EDIT)); return items; }; } #endregion #region DMTreeGroup else if (DanhMuc is DMTreeGroup) { DMTreeGroup basic = (DMTreeGroup)DanhMuc; return delegate(object formCategory) { List<Object> items = new List<Object>(); ApplyPermissionAction.ApplyPermissionObject(items, basic, per.GetPermissionItem(PermissionType.VIEW)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnAdd, per.GetPermissionItem(PermissionType.ADD)); ApplyPermissionAction.ApplyPermissionObject(items, basic.addSameLevel, per.GetPermissionItem(PermissionType.ADD)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnDel, per.GetPermissionItem(PermissionType.DELETE)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnUpdate, per.GetPermissionItem(PermissionType.EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnLuu, per.GetPermissionItem(PermissionType.ADD_EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnKhongLuu, per.GetPermissionItem(PermissionType.ADD_EDIT)); return items; }; } #endregion #region DMTreeGroupElement else if (DanhMuc is DMTreeGroupElement) { DMTreeGroupElement basic = (DMTreeGroupElement)DanhMuc; return delegate(object formCategory) { List<Object> items = new List<Object>(); ApplyPermissionAction.ApplyPermissionObject(items, basic, per.GetPermissionItem(PermissionType.VIEW)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnAdd, per.GetPermissionItem(PermissionType.ADD)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnDel, per.GetPermissionItem(PermissionType.DELETE)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnUpdate, per.GetPermissionItem(PermissionType.EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnSave, per.GetPermissionItem(PermissionType.ADD_EDIT)); ApplyPermissionAction.ApplyPermissionObject(items, basic.btnNoSave, per.GetPermissionItem(PermissionType.ADD_EDIT)); return items; }; } #endregion PLMessageBoxDev.ShowMessage("Loại danh mục " + DanhMuc.GetType().Name + " chưa được hỗ trợ"); return null; }
public void AddTab(XtraUserControl userControl, string titleTab, bool newTab) { tabUtil.AddTab(userControl, titleTab, newTab); }
public void AddTabAndCloseCurrent(XtraUserControl userControl, string titleTab, bool newTab) { tabUtil.CloseSelectedPage(); tabUtil.AddTab(userControl, titleTab, newTab); }
public static DelegationLib.DefinePermission GetPermission(XtraUserControl DM, String feature) { return DanhMucPermission.GetPermission(DM, feature); }
private void ShowUserControl(XtraUserControl userControl) { if (isBusy) return; ClearUserControl(); userControl.Dock = DockStyle.Fill; splitContainerControl.Panel2.Controls.Add(userControl); }
public void AddPanel(Param.Screen screen) { switch (screen) { case Param.Screen.Sale: if (_UC_SALE == null) _UC_SALE = new UcSale(); _USER_CONTROL = _UC_SALE; _UC_SALE.LoadData(); break; case Param.Screen.ReceiveProduct: if (_UC_RECEIVE_PRODUCT == null) _UC_RECEIVE_PRODUCT = new UcReceiveProduct(); _USER_CONTROL = _UC_RECEIVE_PRODUCT; _UC_RECEIVE_PRODUCT._FIRST_LOAD = true; _UC_RECEIVE_PRODUCT.LoadData(); _UC_RECEIVE_PRODUCT.SearchData(); break; case Param.Screen.Stock: if (_UC_STOCK == null) _UC_STOCK = new UcStock(); _USER_CONTROL = _UC_STOCK; _UC_STOCK.LoadData(); break; case Param.Screen.Product: if (_UC_PRODUCT == null) _UC_PRODUCT = new UcProduct(); _USER_CONTROL = _UC_PRODUCT; _UC_PRODUCT._FIRST_LOAD = true; _UC_PRODUCT.LoadData(); break; case Param.Screen.Customer: if (_UC_CUSTOMER == null) _UC_CUSTOMER = new UcCustomer(); _USER_CONTROL = _UC_CUSTOMER; _UC_CUSTOMER.LoadData(); break; case Param.Screen.Report: if (_UC_REPORT == null) _UC_REPORT = new UcReport(); _USER_CONTROL = _UC_REPORT; _UC_REPORT.LoadData(); break; case Param.Screen.Config: if (_UC_CONFIG == null) _UC_CONFIG = new UcConfig(); _USER_CONTROL = _UC_CONFIG; _UC_CONFIG.LoadData(); break; case Param.Screen.Claim: if (_UC_CLAIM == null) _UC_CLAIM = new UcClaim(); _USER_CONTROL = _UC_CLAIM; break; case Param.Screen.ReportStock: if (_UC_REPORT_STOCK == null) _UC_REPORT_STOCK = new UcReportStock(); _USER_CONTROL = _UC_REPORT_STOCK; break; case Param.Screen.Credit: if (_UC_CREDIT == null) _UC_CREDIT = new UcCredit(); _USER_CONTROL = _UC_CREDIT; _UC_CREDIT.LoadData(); break; case Param.Screen.ReportProduct: if (_UC_REPORT_PORDUCT == null) _UC_REPORT_PORDUCT = new UcReportProduct(); _USER_CONTROL = _UC_REPORT_PORDUCT; _UC_REPORT_PORDUCT.LoadData(); break; } if (!pnlMain.Contains(_USER_CONTROL)) { pnlMain.Controls.Clear(); _USER_CONTROL.Dock = DockStyle.Fill; pnlMain.Controls.Add(_USER_CONTROL); } }
void InitCountryPropertiesControl() { if (_currentControl == null || !(_currentControl is UCCountryProperties)) { ReleaseControl(); ucCountryProperties = new UCCountryProperties(); ucCountryProperties.Parent = pcClient; ucCountryProperties.Dock = DockStyle.Fill; ucCountryProperties.Show(); ucCountryProperties.Init(); ucCountryProperties.Entity = Entity; _currentControl = ucCountryProperties; CreateBarControl(); } }
public static void ShowCategory(XtraUserControl control, String Title, Size? size) { frmCategoryDialog item = new frmCategoryDialog(control, Title, size); ProtocolForm.ShowModalDialog(FrameworkParams.MainForm, item); }
void InitAvgWorkingDaysInWeekControl() { if (_currentControl == null || !(_currentControl is UCAvgWorkingDaysInWeek)) { ReleaseControl(); ucAvgWDIWeekControl = new UCAvgWorkingDaysInWeek(); ucAvgWDIWeekControl.Parent = pcClient; ucAvgWDIWeekControl.Dock = DockStyle.Fill; ucAvgWDIWeekControl.Show(); ucAvgWDIWeekControl.Entity = Entity; _currentControl = ucAvgWDIWeekControl; CreateBarControl(); } }
private void CambiarDetalle(XtraUserControl detalle) { var contenedor = panelControlContenido; if (transitionManager1.IsTransition) { transitionManager1.EndTransition(); } transitionManager1.StartTransition(contenedor); try { contenedor.Controls.Clear(); Control find = detalle; CurrentControl = detalle; find.Parent = contenedor; find.Dock = DockStyle.Fill; find.BringToFront(); } finally { transitionManager1.EndTransition(); } }
private void AddPanel(Screen screen) { switch (screen) { case Screen.Sale: if (_UC_SALE == null) _UC_SALE = new UcSale(); _USER_CONTROL = _UC_SALE; break; case Screen.ReceiveProduct: if (_UC_RECEIVE_PRODUCT == null) _UC_RECEIVE_PRODUCT = new UcReceiveProduct(); _USER_CONTROL = _UC_RECEIVE_PRODUCT; break; case Screen.Stock: if (_UC_STOCK == null) _UC_STOCK = new UcStock(); _USER_CONTROL = _UC_STOCK; break; } if (!panelMain.Contains(_USER_CONTROL)) { panelMain.Controls.Clear(); _USER_CONTROL.Dock = DockStyle.Fill; panelMain.Controls.Add(_USER_CONTROL); } }