private void ScCopyBankCD_CodeKeyDownEvent(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { ScCopyBankCD.ChangeDate = string.IsNullOrWhiteSpace(ScCopyBranchCD.ChangeDate) ? bbl.GetDate() : ScCopyBranchCD.ChangeDate;; if (!string.IsNullOrWhiteSpace(ScCopyBankCD.TxtCode.Text)) { ScCopyBankCD.ChangeDate = string.IsNullOrWhiteSpace(ScCopyBranchCD.ChangeDate) ? bbl.GetDate() : ScCopyBranchCD.ChangeDate; if (ScCopyBankCD.SelectData()) { ScCopyBranchCD.Value1 = ScCopyBankCD.TxtCode.Text; ScCopyBranchCD.Value2 = ScCopyBankCD.LabelText; } else { mtbstbl.ShowMessage("E101"); ScCopyBankCD.SetFocus(1); } } } }
private void F11() { if (ErrorCheck(11)) { switch (OperationMode) { case EOperationMode.INSERT: if (type == 1) { ScCopyBankCD.SetFocus(1); } else { if (string.IsNullOrWhiteSpace(ScCopyBranchCD.TxtChangeDate.Text) || DisplayData(ScCopyBranchCD)) { DisablePanel(PanelHeader); F11Enable = false; btnDisplay.Enabled = false; EnablePanel(PanelDetail); SelectNextControl(PanelDetail, true, true, true, true); } } break; case EOperationMode.UPDATE: if (DisplayData(ScBranchCD)) { //DisablePanel(PanelCopy); DisablePanel(PanelHeader); EnablePanel(PanelDetail); F11Enable = false; btnDisplay.Enabled = false; //DisablePanel(PanelNormal); //F11Enable = false; F12Enable = true; SelectNextControl(PanelDetail, true, true, true, true); } break; case EOperationMode.DELETE: if (DisplayData(ScBranchCD)) { //DisablePanel(PanelCopy); DisablePanel(PanelHeader); F11Enable = false; btnDisplay.Enabled = false; //DisablePanel(PanelNormal); DisablePanel(PanelDetail); SelectNextControl(PanelDetail, true, true, true, true); F12Enable = true; F11Enable = false; } break; case EOperationMode.SHOW: if (DisplayData(ScBranchCD)) { //DisablePanel(PanelCopy); DisablePanel(PanelHeader); F11Enable = false; btnDisplay.Enabled = false; //DisablePanel(PanelNormal); DisablePanel(PanelDetail); F12Enable = false; } break; } //***Add Control Enable/Disable; } }