private void F11() { if (ErrorCheck(11)) { switch (OperationMode) { case EOperationMode.INSERT: //if (type == 1) // txtKouzaName.Focus(); //else //{ // if (DisplayData(ScCopyKouzaCD)) // txtKouzaName.Focus(); //} if (type == 1) { ScCopyKouzaCD.SetFocus(1); } else { if (string.IsNullOrWhiteSpace(ScCopyKouzaCD.TxtChangeDate.Text) || (DisplayData(ScCopyKouzaCD))) { DisablePanel(panel1); DisablePanel(panel2); btnDisplay.Enabled = false; Btn_F11.Enabled = false; EnablePanel(PanelDetail); txtKouzaName.Focus(); } } break; case EOperationMode.UPDATE: if (DisplayData(ScKouzaCD)) { DisablePanel(panel1); DisablePanel(panel2); btnDisplay.Enabled = false; Btn_F11.Enabled = false; DisablePanel(PanelHeader); EnablePanel(PanelDetail); F12Enable = true; txtKouzaName.Focus(); } break; case EOperationMode.DELETE: if (DisplayData(ScKouzaCD)) { DisablePanel(panel1); DisablePanel(panel2); DisablePanel(PanelDetail); txtKouzaName.Focus(); F12Enable = true; } break; case EOperationMode.SHOW: if (DisplayData(ScKouzaCD)) { DisablePanel(panel1); DisablePanel(panel2); DisablePanel(PanelDetail); txtKouzaName.Focus(); F12Enable = false; } break; } } }
private bool ErrorCheck(int index) { mtbbl = new MasterTouroku_GinkouKouza_BL(); if (index == 11) { //HeaderCheck on F11 if (OperationMode == EOperationMode.INSERT) { if (type == 1) { if (!RequireCheck(new Control[] { ScKouzaCD.TxtCode, ScKouzaCD.TxtChangeDate })) //,ScCopyKouzaCD.TxtCode,ScCopyKouzaCD.TxtChangeDate { return(false); } } else { if (!RequireCheck(new Control[] { ScKouzaCD.TxtCode, ScKouzaCD.TxtChangeDate })) { return(false); } if (!RequireCheck(new Control[] { ScCopyKouzaCD.TxtCode }, ScCopyKouzaCD.TxtChangeDate)) { return(false); } if (!RequireCheck(new Control[] { ScCopyKouzaCD.TxtChangeDate }, ScCopyKouzaCD.TxtCode)) { return(false); } if (ScKouzaCD.IsExists(1)) { mtbbl.ShowMessage("E132"); ScKouzaCD.SetFocus(1); return(false); } if (!string.IsNullOrWhiteSpace(ScCopyKouzaCD.TxtCode.Text) && !string.IsNullOrWhiteSpace(ScCopyKouzaCD.TxtChangeDate.Text)) { if (!ScCopyKouzaCD.IsExists(1)) { mtbbl.ShowMessage("E133"); ScCopyKouzaCD.SetFocus(1); return(false); } } } } else { if (!ScKouzaCD.IsExists(1)) { mtbbl.ShowMessage("E133"); ScKouzaCD.SetFocus(1); return(false); } } } else if (index == 12) { if (!RequireCheck(new Control[] { ScKouzaCD.TxtCode, ScKouzaCD.TxtChangeDate })) { return(false); } if (OperationMode == EOperationMode.INSERT) { if (ScKouzaCD.IsExists(1)) { mtbbl.ShowMessage("E132"); ScKouzaCD.SetFocus(1); return(false); } } if (!RequireCheck(new Control[] { txtKouzaName })) { return(false); } if (!RequireCheck(new Control[] { ScBankCD.TxtCode })) { return(false); } if (!ScBankCD.IsExists(2)) { mtbbl.ShowMessage("E101"); ScBankCD.SetFocus(1); return(false); } if (!RequireCheck(new Control[] { ScBranchCD.TxtCode })) { return(false); } if (!ScBranchCD.IsExists(2)) { mtbbl.ShowMessage("E101"); ScBranchCD.SetFocus(1); return(false); } if (!RequireCheck(new Control[] { txtKouzaKBN })) { return(false); } if (txtKouzaKBN.Text != "1" && txtKouzaKBN.Text != "2") { mtbbl.ShowMessage("E101"); ScBankCD.SetFocus(1); return(false); } if (!RequireCheck(new Control[] { txtKouzaNO, txtKouzaMeigi })) { return(false); } if (!RequireCheck(new Control[] { txtCompanyName }, txtCompanyCD)) { return(false); } if (!RequireCheck(new Control[] { txtTax11 }, txtFee11)) { return(false); } if (!ReverseRequireCheck(new Control[] { txtFee12 }, txtAmount1)) { return(false); } if (!RequireCheck(new Control[] { txtTax12 }, txtFee12)) { return(false); } if (!RequireCheck(new Control[] { txtTax21 }, txtFee21)) { return(false); } if (!RequireCheck(new Control[] { txtFee22 }, txtAmount2)) { return(false); } if (!RequireCheck(new Control[] { txtTax22 }, txtFee22)) { return(false); } if (!RequireCheck(new Control[] { txtTax31 }, txtFee31)) { return(false); } if (!RequireCheck(new Control[] { txtFee32 }, txtAmount3)) { return(false); } if (!RequireCheck(new Control[] { txtTax32 }, txtFee32)) { return(false); } } return(true); }