public bool intotemp() { Model.BTDJTEMP model = new Model.BTDJTEMP(); int id = 0; try { for (int i = 0; i < dgvPreview.Rows.Count; i++) { id = 0 + i; model.OBJECTCODE = dgvPreview.Rows[i].Cells[0].Value.ToString(); model.SSSSIDCARDNUM = dgvPreview.Rows[i].Cells[1].Value.ToString(); model.SSSSOBJECTNAME = dgvPreview.Rows[i].Cells[2].Value.ToString(); model.REGMONEY = decimal.Parse(dgvPreview.Rows[i].Cells[3].Value.ToString()); model.AMOUNT = decimal.Parse(dgvPreview.Rows[i].Cells[4].Value.ToString()); model.TYPECODE = dgvPreview.Rows[i].Cells[5].Value.ToString(); model.Batchid = batchid; model.Batchcode = batchcode; model.Offset = offset; model.Lssuecycle = cmbCycle.SelectedValue.ToString(); model.Bankcode = cmbbank.SelectedText.ToString(); b_btdj.imptmp(model); } return true; } catch (Exception) { MessageBox.Show("第" + (id + 1).ToString() + "行数据类型不正确!无法导入!"); b_btdj.delete(""); return false; throw; } }
private void btnMatch_Click(object sender, EventArgs e) { Model.BTDJTEMP model = new Model.BTDJTEMP(); bool id = b_btdj.UpObjectid(model); bool ty = b_btdj.UptypeID(model); bool zh = b_btdj.UpAccountnum(model); if (id && ty && zh) { MessageBox.Show("数据比对完成", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }