private int InvCancel(Int32 iInfoNumber, string sInfoTypeCode) { MyTax.InfoTypeCode = sInfoTypeCode; MyTax.InfoNumber = iInfoNumber; MyTax.CancelInv(); iResult = MyTax.RetCode; if (iResult == 6001) { sRetMsg = MyTax.RetCode.ToString() + " 当月发票库未找到该发票"; iResult = 1; return(1); } if (iResult == 6002) { sRetMsg = MyTax.RetCode.ToString() + " 该发票已作废"; iResult = 1; return(1); } if (iResult == 6011) { sRetMsg = MyTax.RetCode.ToString() + " 作废成功"; return(1); } if (iResult == 6012) { sRetMsg = MyTax.RetCode.ToString() + " 未作废"; iResult = 1; return(1); } if (iResult == 6013) { sRetMsg = MyTax.RetCode.ToString() + " 作废失败"; iResult = 1; return(1); } return(0); }
private void btnCancled_Click(object sender, EventArgs e) { int iResult = 0; int iMyRetrun = 0; iCurrentItemId = gridView1.FocusedRowHandle; DataRow row = gridView1.GetDataRow(iCurrentItemId); iCurrentBseqId = Convert.ToString(row["INVSEQID"]); MyTax.InfoKind = iInfoKind; MyTax.InfoTypeCode = Convert.ToString(row["INVOICECODE"]);; MyTax.InfoNumber = Convert.ToInt32(row["INVOICENO"]);; MyTax.CancelInv(); iResult = MyTax.RetCode; if (iResult == 6001) { sRetMsg = MyTax.RetCode.ToString() + " 当月发票库未找到该发票"; iMyRetrun = 1; } if (iResult == 6002) { sRetMsg = MyTax.RetCode.ToString() + " 该发票已作废"; iMyRetrun = 1; } if (iResult == 6011) { sRetMsg = MyTax.RetCode.ToString() + " 作废成功"; InvoiceCancel(iCurrentBseqId, ""); if (iResult == -1) { sRetMsg = " 业务系统作废失败" + sRetMsg; iMyRetrun = 1; } } if (iResult == 6012) { sRetMsg = MyTax.RetCode.ToString() + " 未作废"; iMyRetrun = 1; } if (iResult == 6013) { sRetMsg = MyTax.RetCode.ToString() + " 作废失败"; iMyRetrun = 1; } MessageBox.Show(sRetMsg); }