public InvoiceDataDetail GetInvInfo(string strInvType, string strCode, string strNum) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("FPZL", strInvType); dictionary.Add("FPDM", strCode); dictionary.Add("FPHM", strNum); InvoiceDataDetail detail = new InvoiceDataDetail(); ArrayList list = this.baseDAO.querySQL("aisino.Fwkp.Wbjk.GetInfoXXFP", dictionary); Dictionary <string, object> dictionary2 = new Dictionary <string, object>(); for (int i = 0; i < list.Count; i++) { dictionary2 = list[i] as Dictionary <string, object>; detail.m_strInvType = strInvType; detail.m_strInvCode = strCode; detail.m_strInvNum = strNum; detail.m_dtInvDate = Convert.ToDateTime(dictionary2["KPRQ"].ToString()); detail.m_strBuyerCode = dictionary2["GFSH"].ToString(); detail.m_strBuyerName = dictionary2["GFMC"].ToString(); detail.m_dbAmount = dictionary2["HJJE"].ToString(); detail.m_dbTaxRate = dictionary2["SLV"].ToString(); detail.m_dbTax = dictionary2["HJSE"].ToString(); detail.XFMC = dictionary2["XFMC"].ToString(); detail.XFSH = dictionary2["XFSH"].ToString(); detail.XSBM = dictionary2["XSBM"].ToString(); detail.GFDZDH = dictionary2["GFDZDH"].ToString(); detail.XFDZ = dictionary2["XFDZ"].ToString(); detail.KHYHMC = dictionary2["KHYHMC"].ToString(); detail.ZHD = dictionary2["ZHD"].ToString(); detail.XHD = dictionary2["XHD"].ToString(); detail.SCCJMC = dictionary2["SCCJMC"].ToString(); detail.CM = dictionary2["CM"].ToString(); detail.TYDH = dictionary2["TYDH"].ToString(); detail.MDD = dictionary2["MDD"].ToString(); detail.YYZZH = dictionary2["YYZZH"].ToString(); detail.XFDZDH = dictionary2["XFDZDH"].ToString(); } return(detail); }
public bool WasteHard(string strInvType, string strInvCode, string strInvNum) { string str = this.taxCard.GetCardClock().ToString(); FPLX fplx = 2; if (strInvType == "c") { fplx = 2; } else if (strInvType == "s") { fplx = 0; } else if (strInvType == "f") { fplx = 11; } else if (strInvType == "j") { fplx = 12; } InvoiceType invType = (InvoiceType)CommonTool.GetInvType(strInvType); InvoiceDataDetail detail = this.fpzfDAL.GetInvInfo(strInvType, strInvCode, strInvNum); string str2 = strInvCode; string str3 = strInvNum; string str4 = detail.m_dtInvDate.ToString(); if (detail.m_strBuyerCode.Length == 0) { return(false); } string dbAmount = detail.m_dbAmount; dbAmount = (dbAmount == "") ? "0.00" : dbAmount; string dbTaxRate = "0.00"; if (detail.m_dbTaxRate.Length == 0) { if (fplx == 11) { dbTaxRate = "0.05"; } else { dbTaxRate = "0.04"; } } else { dbTaxRate = detail.m_dbTaxRate; } string dbTax = detail.m_dbTax; dbTax = (dbTax == "") ? "0.00" : dbTax; string strBuyerName = detail.m_strBuyerName; strBuyerName = (strBuyerName == "") ? " " : strBuyerName; byte[] sourceArray = Invoice.get_TypeByte(); byte[] destinationArray = new byte[0x20]; Array.Copy(sourceArray, 0, destinationArray, 0, 0x20); byte[] buffer3 = new byte[0x10]; Array.Copy(sourceArray, 0x20, buffer3, 0, 0x10); byte[] buffer4 = AES_Crypt.Encrypt(ToolUtil.GetBytes("KP" + DateTime.Now.ToString("F")), destinationArray, buffer3); object[] objArray = new object[] { strInvType, str2, Convert.ToInt32(str3) }; Fpxx fpxx = ServiceFactory.InvokePubService("Aisino.Fwkp.QueryFPXX", objArray)[0] as Fpxx; Invoice invoice = new Invoice(false, fpxx, buffer4, null); invoice.set_Hjje(fpxx.je); invoice.set_Hjse(fpxx.se); Fpxx fpData = invoice.GetFpData(); fpData.kprq = fpxx.kprq; fpData.sLv = (detail.m_dbTaxRate.Length == 0) ? "0.00" : fpxx.sLv; byte[] bytes = ToolUtil.GetBytes(MD5_Crypt.GetHashStr("Aisino.Fwkp.Invoice" + invoice.get_Fpdm() + invoice.get_Fphm())); byte[] buffer6 = new byte[0x20]; Array.Copy(bytes, 0, buffer6, 0, 0x20); byte[] buffer7 = new byte[0x10]; Array.Copy(bytes, 0x20, buffer7, 0, 0x10); byte[] inArray = AES_Crypt.Encrypt(ToolUtil.GetBytes(DateTime.Now.ToString("F")), buffer6, buffer7); fpData.gfmc = Convert.ToBase64String(AES_Crypt.Encrypt(ToolUtil.GetBytes(Convert.ToBase64String(inArray) + invoice.get_Gfmc()), buffer6, buffer7)); fpData.zfsj = str; fpData.zfbz = true; fpData.bszt = 0; return(invoice.MakeCardInvoice(fpData, true)); }