private void CheckFormula() { counts = 0; trace = 0; checkResult = false; try { client = new SalaryServiceClient(); string[] codes = txtContentCode.Text.Split(','); if (codes.Length > 0 && CheckSymbol(codes[codes.Length - 2])) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("算法不完整"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("PROMPT"), Utility.GetResourceStr("算法不完整")); return; } bool ret = false; int i = 0; client.CheckCalItemCompleted += new EventHandler <CheckCalItemCompletedEventArgs>(client_CheckCalItemCompleted); foreach (string code in codes) { if (i < codes.Length - 1 && code.Length > 31) { counts++; trace++; client.CheckCalItemAsync(code, code, ret); } i++; } if (trace == 0) { if (Checks()) { checkResult = true; if (isSave) { ExecuteResult(false); } else { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("公式合法"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("PROMPT"), Utility.GetResourceStr("公式合法")); } else { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("公式算法有错"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } // Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("公式算法有错")); } } catch { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("公式算法有错,请核对后处理"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("公式算法有错,请核对后处理")); } }
private void CheckFormula() { counts = 0; trace = 0; checkResult = false; try { client = new SalaryServiceClient(); string[] codes = txtContentCode.Text.Split(','); if (codes.Length > 0 && CheckSymbol(codes[codes.Length - 2])) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("算法不完整"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("PROMPT"), Utility.GetResourceStr("算法不完整")); return; } bool ret = false; int i = 0; client.CheckCalItemCompleted += new EventHandler<CheckCalItemCompletedEventArgs>(client_CheckCalItemCompleted); foreach (string code in codes) { if (i < codes.Length - 1 && code.Length > 31) { counts++; trace++; client.CheckCalItemAsync(code, code, ret); } i++; } if (trace == 0) { if (Checks()) { checkResult = true; if (isSave) ExecuteResult(false); else ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("公式合法"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("PROMPT"), Utility.GetResourceStr("公式合法")); } else ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("公式算法有错"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); // Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("公式算法有错")); } } catch { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("公式算法有错,请核对后处理"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("公式算法有错,请核对后处理")); } }