private void btn_OK_Click(object sender, EventArgs e) { try { if (!File.Exists(this.fileControl1.get_TextBoxFile().Text.Trim())) { MessageManager.ShowMsgBox("INP-274101"); } else { string str = ""; DJZFImportResult result = this.djzfcr.MakeInvalidExecute(this.fileControl1.get_TextBoxFile().Text, ref str); if (result == null) { MessageManager.ShowMsgBox("INP-274103", new string[] { str }); } else { XSDJZuoFeiResult result2 = new XSDJZuoFeiResult(result); base.Close(); this.djzfcr.strBillImportPath = this.fileControl1.get_TextBoxFile().Text.Trim(); result2.ShowInTaskbar = false; result2.ShowDialog(); } } } catch (Exception exception) { MessageManager.ShowMsgBox("INP-274102", new string[] { exception.Message }); } }
private void MakeBillInvalid(string strBillNum, DJZFImportResult ImportResult) { try { string str = ""; string str2 = ""; ArrayList billState = this.MakeBillInvalidDAL.GetBillState(strBillNum); Dictionary <string, object> dictionary = new Dictionary <string, object>(); for (int i = 0; i < billState.Count; i++) { dictionary = billState[i] as Dictionary <string, object>; str = dictionary["DJZT"].ToString(); str2 = dictionary["KPZT"].ToString(); } if (!ImportResult.Result.ContainsKey(strBillNum)) { if (!(this.MakeBillInvalidDAL.RecordIsExist(strBillNum) && (billState.Count >= 0))) { ImportResult.Undo++; ImportResult.Result.Add(strBillNum, "单据不存在"); } else if (str.ToUpper() == "W") { ImportResult.Undo++; ImportResult.Result.Add(strBillNum, "已经作废"); } else { int num2 = this.MakeBillInvalidDAL.MakeBillInvalid(strBillNum); if (((str2.ToUpper() == "Y") || (str2.ToUpper() == "P")) || (str2.ToUpper() == "A")) { ImportResult.Undo++; ImportResult.Result.Add(strBillNum, "已经开票"); } else if ((str2 == "") || (str2.ToUpper() == "X")) { ImportResult.Undo++; ImportResult.Result.Add(strBillNum, "单据不存在"); } else if (num2 > 0) { ImportResult.Success++; ImportResult.Result.Add(strBillNum, "作废成功"); } else { ImportResult.Undo++; ImportResult.Result.Add(strBillNum, "未知错误"); } } } } catch (Exception exception) { ExceptionHandler.HandleError(exception); } }
public DJZFImportResult MakeInvalidExecute(string strWastePath, ref string _strCause) { DJZFImportResult importResult = new DJZFImportResult(); List <string> strBillList = new List <string>(); if (!this.GetBillList(strWastePath, ref strBillList, ref _strCause)) { return(null); } for (int i = 0; i < strBillList.Count; i++) { this.MakeBillInvalid(strBillList[i], importResult); } return(importResult); }
public XSDJZuoFeiResult(DJZFImportResult result) { this.Initialize(); this.ImportResult = result; }