private void ChangeMode(EOperationMode OperationMode) { base.OperationMode = OperationMode; switch (OperationMode) { case EOperationMode.INSERT: Clear(PanelHeader); Clear(PanelDetail); EnablePanel(PanelHeader); DisablePanel(PanelDetail); GvTana.ClearSelection(); GvTana.Enabled = false; ScSoukoCD.SearchEnable = false; ScCopySoukoCD.SearchEnable = true; ScCopySoukoCD.Enabled = true; F9Visible = false; F12Enable = true; btnDisplay.Enabled = F11Enable = true; break; case EOperationMode.UPDATE: case EOperationMode.DELETE: case EOperationMode.SHOW: Clear(PanelHeader); Clear(PanelDetail); EnablePanel(PanelHeader); DisablePanel(PanelDetail); GvTana.Enabled = false; GvTana.ClearSelection(); ScSoukoCD.SearchEnable = true; ScCopySoukoCD.Enabled = false; F12Enable = false; btnDisplay.Enabled = F11Enable = true; break; } ScSoukoCD.Focus(); }
/// <summary> /// F2 & F3 Mode /// </summary> /// <param name="mode"></param> #region Function 11 & 12 private void F11() { if (ErrorCheck(11)) { switch (OperationMode) { case EOperationMode.INSERT: if (type == 1) { ScCopySoukoCD.SetFocus(1); } else { if (string.IsNullOrWhiteSpace(ScCopySoukoCD.TxtChangeDate.Text) || DisplayData(ScCopySoukoCD)) { DisablePanel(PanelHeader); EnablePanel(PanelDetail); GvTana.Enabled = true; F11Enable = false; btnDisplay.Enabled = false; TxtSoukoName.Focus(); } } break; case EOperationMode.UPDATE: if (DisplayData(ScSoukoCD)) { DisablePanel(PanelHeader); EnablePanel(PanelDetail); F12Enable = true; F11Enable = false; GvTana.Enabled = true; btnDisplay.Enabled = false; SelectNextControl(PanelDetail, true, true, true, true); } break; case EOperationMode.DELETE: if (DisplayData(ScSoukoCD)) { DisablePanel(PanelHeader); DisablePanel(PanelDetail); GvTana.Enabled = false; GvTana.ClearSelection(); F11Enable = false; btnDisplay.Enabled = false; SelectNextControl(PanelDetail, true, true, true, true); F12Enable = true; } break; case EOperationMode.SHOW: if (DisplayData(ScSoukoCD)) { DisablePanel(PanelHeader); DisablePanel(PanelDetail); GvTana.Enabled = false; F11Enable = false; btnDisplay.Enabled = false; F12Enable = false; } break; } CustomEnable(); //***Add Control Enable/Disable; } }