private void RetrieveData() { try { BindSearchData(); DataTable dtbView = m_bizMaster.RetrieveData(searchCostType, searchDesc, searchCostGrp); if (!Util.IsNullOrEmptyOrZero(dtbView.Rows.Count)) { dgvCostType.DataSource = dtbView; ControlUtil.EnabledControl(true, m_toolBarEdit, m_toolBarDelete); isSearch = true; //flag refresh grid } else { dgvCostType.DataSource = null; ControlUtil.EnabledControl(false, m_toolBarEdit, m_toolBarDelete); //MessageBox.Show("Data not Found.", "ACS110", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { ExceptionManager.ManageException(this, ex); } }
public override void SetScreenMode(eScreenMode eScreenMode) { base.SetScreenMode(eScreenMode); switch (eScreenMode) { case eScreenMode.Idle: ControlUtil.EnabledControl(true, m_toolBarClose, m_toolBarAdd, m_toolBarFind); ControlUtil.EnabledControl(false, m_toolBarEdit, m_toolBarDelete, m_toolBarSave, m_toolBarCancel, m_toolBarRefresh, m_toolBarPrint, m_toolBarImport, m_toolBarExport); break; case eScreenMode.View: ControlUtil.EnabledControl(true, m_toolBarClose, m_toolBarAdd, m_toolBarEdit, m_toolBarDelete, m_toolBarRefresh, m_toolBarPrint, m_toolBarImport, m_toolBarExport, m_toolBarFind); ControlUtil.EnabledControl(false, m_toolBarSave, m_toolBarCancel); break; case eScreenMode.Add: ControlUtil.EnabledControl(false, m_toolBarClose, m_toolBarAdd, m_toolBarEdit, m_toolBarDelete, m_toolBarRefresh, m_toolBarPrint, m_toolBarImport, m_toolBarExport, m_toolBarFind); ControlUtil.EnabledControl(true, m_toolBarSave, m_toolBarCancel); break; case eScreenMode.Edit: ControlUtil.EnabledControl(false, m_toolBarClose, m_toolBarAdd, m_toolBarEdit, m_toolBarDelete, m_toolBarRefresh, m_toolBarPrint, m_toolBarImport, m_toolBarExport, m_toolBarFind); ControlUtil.EnabledControl(true, m_toolBarSave, m_toolBarCancel); break; case eScreenMode.Custom: break; } }
public override void SetScreenMode(eScreenMode eScreenMode) { base.SetScreenMode(eScreenMode); // ÊÓËÃѺ㹠Base class ¨ÐÁÕ function ÊÓËÃѺ Enabled & Disabled ¡Ñº Toolbar ÍÂÙèáÅéÇ àÃÕ¡ãªéä´éàÅ // TODO : Enabled & Disabled Control µèÒ§ æ µÒÁ mode ¢Í§ Screen m_dlgFindUser = new FindUserDialog(new FindDialogSqlDAO(AppEnvironment.Database), true, true); switch (ScreenMode) { case eScreenMode.Idle: ControlUtil.EnabledControl(false, grpAddEdit); ControlUtil.ClearControlData(grpAddEdit.Controls); lstvMember.Items.Clear(); break; case eScreenMode.View: ControlUtil.EnabledControl(false, grpAddEdit); break; case eScreenMode.Add: ControlUtil.EnabledControl(true, grpAddEdit); lstvMember.Items.Clear(); break; case eScreenMode.Edit: ControlUtil.EnabledControl(true, grpAddEdit); break; } }
public override bool OnCommandEdit() { try { this.Cursor = Cursors.WaitCursor; SetScreenMode(eScreenMode.Edit); ControlUtil.EnabledControl(true, grpAddEdit.Controls); txtGroupName.Focus(); txtGroupName.SelectAll(); gvResult.Enabled = false; DataRow dr = ((DataTable)gvResult.DataSource).Rows[gvResult.CurrentRow.Index]; dr[(int)eColDetail.UpdateDate] = DateTime.Now; dr[(int)eColDetail.UpdateUser] = AppEnvironment.UserLogin; return(true); } catch (Exception ex) { ExceptionManager.ManageException(this, ex); return(false); } finally { this.Cursor = Cursors.Default; } }
public override void SetScreenMode(eScreenMode eScreenMode) { base.SetScreenMode(eScreenMode); // ÊÓËÃѺ㹠Base class ¨ÐÁÕ function ÊÓËÃѺ Enabled & Disabled ¡Ñº Toolbar ÍÂÙèáÅéÇ àÃÕ¡ãªéä´éàÅ // m_dlgFindUserGroup = new FindUserGroupDialog(new FindDialogSqlDAO(AppEnvironment.Database), true, true); switch (eScreenMode) { case eScreenMode.Idle: ControlUtil.ClearControlData(this.Controls); ControlUtil.EnabledControl(false, this.Controls); ControlUtil.EnabledControl(true, m_toolBarExport); break; case eScreenMode.View: ControlUtil.EnabledControl(false, this.Controls); break; case eScreenMode.Edit: ControlUtil.EnabledControl(true, this.Controls); break; case eScreenMode.Add: ControlUtil.ClearControlData(this.Controls); ControlUtil.EnabledControl(true, this.Controls); break; } ControlUtil.EnabledControl(false, txtCreateDate, txtCreateUser, txtUpdateDate, txtUpdateUser); }
/// <summary> /// Function ¹Õé¨Ð¶Ù¡àÃÕÂÍ¡àÁ×èͼÙéãªé Click ·Õè ToolbarAdd /// </summary> /// <returns>Bool</returns> public override bool OnCommandAdd() { try { this.Cursor = Cursors.WaitCursor; SetScreenMode(eScreenMode.Add); ControlUtil.ClearControlData(grpAddEdit.Controls); lstvMember.Items.Clear(); ControlUtil.EnabledControl(true, grpAddEdit.Controls); // TODO : ¡Ó˹´¤èÒàÃÔèÁµé¹ãËé¡Ñº Control µèÒ§ æ ·ÕèÍÂÙè㹡ÅØèÁ Add/Edit // Example : txtGroupName.Text = string.Empty; txtDescription.Text = string.Empty; // TODO : ¡Ó˹´¤èÒàÃÔèÁµé¹ãËé¡Ñº Column µèÒ§ æ gvResult.Enabled = false; gvResult.ClearSelection(); return(true); } catch (Exception ex) { ExceptionManager.ManageException(this, ex); return(false); } finally { this.Cursor = Cursors.Default; } }
public override bool OnCommandEdit() { EnableControl(eScreenMode.Edit); ControlUtil.EnabledControl(false, m_toolBarAdd, m_toolBarDelete); BindDataForEdit(); return(true); }
private void dgvMappingCost_SelectionChanged(object sender, EventArgs e) { if (dgvMappingCost.SelectedRows.Count > 0) { ControlUtil.EnabledControl(true, m_toolBarDelete, m_toolBarAdd, m_toolBarEdit); //dgvProductionCost.ClearSelection(); } }
private void InitialScreen() { EnableControl(eScreenMode.View); ControlUtil.VisibleControl(false, m_toolBarFind, m_toolBarPrint, m_toolBarExport, m_toolBarImport, m_toolBarSave, m_toolBarCancel); ControlUtil.EnabledControl(false, m_toolBarEdit, m_toolBarDelete); UpdateToolbarSeparator(); dgvCostType.AutoGenerateColumns = false; BindSearchCostGroupCombobox(); }
private void ClearScreen() { txtSearchCostType.Text = string.Empty; txtSearchDescription.Text = string.Empty; cmbSearchCostGroup.SelectedIndex = 0; dgvCostType.DataSource = null; isSearch = false; ControlUtil.EnabledControl(false, m_toolBarEdit, m_toolBarDelete); }
public FrmADM010_UserMaintenance() { InitializeComponent(); m_bizUser = new UserBIZ(AppEnvironment.Database); ControlUtil.VisibleControl(false, m_toolBarExport, m_toolBarImport, m_toolBarPrint); ControlUtil.VisibleControl(false, m_toolBarPrint); ControlUtil.VisibleControl(true, m_toolBarExport); ControlUtil.EnabledControl(false, this.Controls); }
private void SafeEnableControl(bool bEnabled, params Control[] controls) { if (this.InvokeRequired) { this.Invoke((Action)(() => { SafeEnableControl(bEnabled, controls); })); return; } ControlUtil.EnabledControl(bEnabled, controls); }
private void Cancel() { EnableControl(eScreenMode.View); clearControl(); errorProvider.Clear(); txtSearchCostType.Focus(); isAddMode = false; ControlUtil.EnabledControl(true, m_toolBarAdd, m_toolBarRefresh); if (isSearch) { ControlUtil.EnabledControl(true, m_toolBarEdit, m_toolBarDelete); } }
private void dgvProductionCost_SelectionChanged(object sender, EventArgs e) { if (dgvProductionCost.SelectedRows.Count > 0) { ControlUtil.EnabledControl(false, m_toolBarDelete, m_toolBarEdit); ControlUtil.EnabledControl(true, m_toolBarAdd); foreach (DataGridViewRow row in dgvProductionCost.SelectedRows) { mapAccCode = row.Cells[0].Value.ToString(); } RetrieveMappingCostData(mapAccCode); //dgvMappingCost.ClearSelection(); } }
private void InitialScreen() { m_bInitial = true; try { // Initial Control Property ControlUtil.ClearControlData(txtCompany); ControlUtil.EnabledControl(false, btnChangePassword); lblVersion.Text = @"Version: " + Application.ProductVersion; } finally { m_bInitial = false; } }
public void UpdateBindedControlLook() { bool bFocused = false; if (this.DesignMode == false) { foreach (BindedControl bc in m_arBindedControls) { if (bc.Control != null) { ControlUtil.EnabledControl(this.Checked && this.Enabled, bc.Control); if (bc.Control.CanFocus && !bFocused && this.Checked && this.Enabled) { bc.Control.Focus(); if (bc.Control is TextBoxBase) { ((TextBoxBase)bc.Control).SelectAll(); } bFocused = true; } } } } }
private void EnableControl(eScreenMode eScreenMode) { switch (eScreenMode) { case eScreenMode.View: txtAddCostType.Enabled = false; txtAddDescription.Enabled = false; cmbAddCostGroup.Enabled = false; cmbAddProcess.Enabled = false; radioBtnType1.Enabled = false; radioBtnType2.Enabled = false; btnSave.Enabled = false; btnCancel.Enabled = false; btnSearch.Enabled = true; btnClear.Enabled = true; txtSearchCostType.Enabled = true; txtSearchDescription.Enabled = true; cmbSearchCostGroup.Enabled = true; break; case eScreenMode.Add: ControlUtil.EnabledControl(false, m_toolBarAdd, m_toolBarRefresh); txtAddCostType.Enabled = true; txtAddDescription.Enabled = true; cmbAddCostGroup.Enabled = true; cmbAddProcess.Enabled = true; radioBtnType1.Enabled = true; radioBtnType2.Enabled = true; btnSave.Enabled = true; btnCancel.Enabled = true; txtSearchCostType.Enabled = false; txtSearchDescription.Enabled = false; cmbSearchCostGroup.Enabled = false; btnSearch.Enabled = false; btnClear.Enabled = false; BindCostGroupCombobox(); BindProcessCombobox(); radioBtnType1.Checked = true; break; case eScreenMode.Edit: txtSearchCostType.Enabled = false; txtSearchDescription.Enabled = false; cmbSearchCostGroup.Enabled = false; btnSearch.Enabled = false; btnClear.Enabled = false; txtAddCostType.Enabled = false; txtAddDescription.Enabled = true; cmbAddCostGroup.Enabled = true; cmbAddProcess.Enabled = true; radioBtnType1.Enabled = true; radioBtnType2.Enabled = true; btnSave.Enabled = true; btnCancel.Enabled = true; break; } }
private void UpdateEnableChangePasswordButton() { ControlUtil.EnabledControl(CurrentUser != null, btnChangePassword); }