public void UpdateXSDJMX_FPDM_FPHM(FPGenerateResult result) { List <string> list = new List <string>(); List <Dictionary <string, object> > list2 = new List <Dictionary <string, object> >(); for (int i = 0; i < result.ListXSDJ_MX.Count; i++) { string bH = ""; int xH = 0; if (string.IsNullOrEmpty(result.YBH)) { bH = result.BH; xH = result.ListXSDJ_MX[i].XH; } else { bH = result.YBH; xH = Convert.ToInt32(result.ListXSDJ_MX[i].Reserve); } Dictionary <string, object> item = new Dictionary <string, object>(); item.Add("XSDJBH", bH); item.Add("XH", xH); item.Add("FPZL", result.DJZL); item.Add("FPDM", result.FPDM); item.Add("FPHM", result.FPHM); item.Add("SCFPXH", i + 1); list.Add("aisino.Fwkp.Wbjk.FPSC_UpdateXSDJMX"); list2.Add(item); } if ((list.Count > 0) && (list2.Count > 0)) { this.baseDAO.updateSQLTransaction(list.ToArray(), list2); } }
private void GenerateFPResult_Load(object sender, EventArgs e) { try { if ((this.ListFPGenerateResult.Count > 0) && (this.ListFPGenerateResult[0].DJZL == "j")) { this.fpGrid.Columns.Add("XH", "序号"); this.fpGrid.Columns.Add("FPZL", "发票种类"); this.fpGrid.Columns.Add("FPDM", "发票代码"); this.fpGrid.Columns.Add("FPHM", "发票号码"); this.fpGrid.Columns.Add("KPJG", "开具结果"); this.fpGrid.Columns.Add("DJH", "单据号"); this.fpGrid.Columns.Add("KKPX", "可开票性"); this.fpGrid.Columns.Add("KPZL", "开票种类"); this.fpGrid.Columns.Add("SXYY", "受限原因"); this.fpGrid.Columns.Add("SLV", "增值税税率或征收率"); this.fpGrid.Columns.Add("KPJE", "价税合计"); this.fpGrid.Columns.Add("KPSE", "增值税税额"); } else { this.fpGrid.Columns.Add("XH", "序号"); this.fpGrid.Columns.Add("FPZL", "发票种类"); this.fpGrid.Columns.Add("FPDM", "发票代码"); this.fpGrid.Columns.Add("FPHM", "发票号码"); this.fpGrid.Columns.Add("KPJG", "开具结果"); this.fpGrid.Columns.Add("DJH", "单据号"); this.fpGrid.Columns.Add("KKPX", "可开票性"); this.fpGrid.Columns.Add("KPZL", "开票种类"); this.fpGrid.Columns.Add("SXYY", "受限原因"); this.fpGrid.Columns.Add("SLV", "税率"); this.fpGrid.Columns.Add("KPJE", "开票金额"); this.fpGrid.Columns.Add("KPSE", "开票税额"); } this.fpGrid.Columns["FPHM"].DefaultCellStyle.Format = "00000000"; this.fpGrid.Columns["KPJE"].DefaultCellStyle.Format = "N"; this.fpGrid.Columns["KPSE"].DefaultCellStyle.Format = "N"; this.fpGrid.Columns["SLV"].DefaultCellStyle.Format = "0%"; this.fpGrid.Columns["KPJE"].DefaultCellStyle.Format = "0.00"; this.fpGrid.Columns["KPSE"].DefaultCellStyle.Format = "0.00"; this.fpGrid.Columns["KPJE"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; this.fpGrid.Columns["KPSE"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; this.fpGrid.ReadOnly = true; this.fpGrid.AllowUserToAddRows = false; this.fpGrid.Rows.Clear(); this.fpGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect; int count = this.ListFPGenerateResult.Count; int num2 = 0; this.fpGrid.Rows.Add(count); for (int i = 0; i < count; i++) { FPGenerateResult result = this.ListFPGenerateResult[i]; this.fpGrid.Rows[i].Cells["XH"].Value = i + 1; int num4 = this.fpGrid.Rows.Count; if (result.DJZL == "c") { if (result.TYDH == "1") { this.fpGrid.Rows[i].Cells["FPZL"].Value = "农产品销售发票"; } else if (result.TYDH == "2") { this.fpGrid.Rows[i].Cells["FPZL"].Value = "收购发票"; } else { this.fpGrid.Rows[i].Cells["FPZL"].Value = "普通发票"; } } else if (result.DJZL == "s") { this.fpGrid.Rows[i].Cells["FPZL"].Value = "专用发票"; } else if (result.DJZL == "f") { this.fpGrid.Rows[i].Cells["FPZL"].Value = "货物运输业增值税专用发票"; } else if (result.DJZL == "j") { this.fpGrid.Rows[i].Cells["FPZL"].Value = "机动车销售统一发票"; } bool flag = false; if ((result.DJZL == "c") || (result.DJZL == "s")) { int num5 = result.ListXSDJ_MX.Count; double sLV = 0.0; for (int j = 0; j < num5; j++) { if (j == 0) { sLV = result.ListXSDJ_MX[j].SLV; } else if (!(sLV == result.ListXSDJ_MX[j].SLV)) { flag = true; break; } } } this.fpGrid.Rows[i].Cells["FPDM"].Value = result.FPDM; this.fpGrid.Rows[i].Cells["FPHM"].Value = result.FPHM; this.fpGrid.Rows[i].Cells["KPJG"].Value = result.KPJG; this.fpGrid.Rows[i].Cells["DJH"].Value = result.BH; this.fpGrid.Rows[i].Cells["KKPX"].Value = result.KKPX; if ((result.KPZL == "清单开票") && (result.KPJE < 0.0)) { this.fpGrid.Rows[i].Cells["KPZL"].Value = "清单汇总"; } else { this.fpGrid.Rows[i].Cells["KPZL"].Value = result.KPZL; } this.fpGrid.Rows[i].Cells["SXYY"].Value = result.SXYY; if (flag) { this.fpGrid.Rows[i].Cells["SLV"].Value = "多税率"; } else if (result.SLV == 0.0) { this.fpGrid.Rows[i].Cells["SLV"].Value = "0%"; } else if (((result.DJZL == "s") && (result.SLV == 0.05)) && result.HYSY) { this.fpGrid.Rows[i].Cells["SLV"].Value = "中外合作油气田"; } else if (!((result.SLV != 0.015) || result.HYSY)) { this.fpGrid.Rows[i].Cells["SLV"].Value = Convert.ToSingle(result.SLV).ToString("0.0%"); } else { this.fpGrid.Rows[i].Cells["SLV"].Value = result.SLV; } if (this.fpGrid.Rows[i].Cells["FPZL"].Value.ToString().Equals("机动车销售统一发票")) { double round = SaleBillCtrl.GetRound((double)(result.KPJE / (1.0 + result.SLV)), 2); double num9 = result.KPJE - round; this.fpGrid.Rows[i].Cells["KPJE"].Value = result.KPJE; this.fpGrid.Rows[i].Cells["KPSE"].Value = num9; } else { this.fpGrid.Rows[i].Cells["KPJE"].Value = result.KPJE; this.fpGrid.Rows[i].Cells["KPSE"].Value = result.KPSE; } if (result.KPJG == "开票失败") { this.fpGrid.Rows[i].Cells["KPJG"].Style.ForeColor = Color.Red; this.fpGrid.Rows[i].Cells["FPHM"].Value = ""; num2++; } } if (this.ListFPGenerateResult.Count > 0) { this.toolStripStatusLabel1.Text = 1 + "/" + this.ListFPGenerateResult.Count; } else { this.toolStripStatusLabel1.Text = ""; } } catch (Exception exception) { if (exception.ToString().Contains("超时")) { this.log.Error(exception.ToString()); } else { HandleException.HandleError(exception); } } }
private void listView1_MouseClick(object sender, MouseEventArgs e) { try { ListViewItem itemAt = this.listView1.GetItemAt(e.X, e.Y); if (itemAt.Name != "MX") { FPGenerateResult tag = (FPGenerateResult)itemAt.Tag; if (tag.DJZL != "j") { int num2; int index = itemAt.Index + 1; if ((index < this.listView1.Items.Count) && (this.listView1.Items[index].Name == "MX")) { for (num2 = 0; num2 < (tag.ListXSDJ_MX.Count + 1); num2++) { this.listView1.Items.RemoveAt(index); } } else { ListViewItem item = new ListViewItem { ForeColor = Color.Red, Name = "MX", Font = new Font("宋体", 10f) }; item.SubItems.Add("序号"); item.SubItems.Add("货物名称"); item.SubItems.Add("规格型号"); item.SubItems.Add("单位"); item.SubItems.Add("数量"); item.SubItems.Add("单价"); item.SubItems.Add("金额"); item.SubItems.Add("税额"); item.SubItems.Add("税率"); this.listView1.Items.Insert(index, item); for (num2 = 0; num2 < tag.ListXSDJ_MX.Count; num2++) { decimal num4; XSDJ_MXModel model = tag.ListXSDJ_MX[num2]; ListViewItem item3 = new ListViewItem { Name = "MX", ForeColor = Color.Blue, Font = new Font("宋体", 10f) }; int num3 = num2 + 1; item3.SubItems.Add(num3.ToString()); item3.SubItems.Add(model.SPMC); item3.SubItems.Add(model.GGXH); item3.SubItems.Add(model.JLDW); string text = (model.SL == 0.0) ? "" : (num4 = (decimal)model.SL).ToString(); item3.SubItems.Add(text); string str2 = (model.DJ == 0.0) ? "" : (num4 = (decimal)model.DJ).ToString(); item3.SubItems.Add(str2); item3.SubItems.Add(model.JE.ToString("F")); item3.SubItems.Add(model.SE.ToString("F")); string str3 = ""; if (model.SLV == 0.0) { str3 = "0%"; } else if (((tag.DJZL == "s") && (model.SLV == 0.05)) && tag.HYSY) { str3 = "中外合作油气田"; } else if (!((model.SLV != 0.015) || tag.HYSY)) { str3 = model.SLV.ToString("0.0%"); } else { str3 = model.SLV.ToString("0%"); } item3.SubItems.Add(str3); this.listView1.Items.Insert((index + 1) + num2, item3); } } } } } catch (Exception exception) { HandleException.HandleError(exception); } }