88 lines
2.4 KiB
C#
88 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using SOH.Kernel;
|
|
using EAS;
|
|
using EAS.Services;
|
|
using SOH.BLL;
|
|
using SOH.Entities.DTO;
|
|
using SOH.Data;
|
|
using SOH.Entities;
|
|
|
|
namespace SOH.ShouFei
|
|
{
|
|
public partial class frmTJJXMX : Form
|
|
{
|
|
public frmTJJXMX()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public frmTJJXMX(int htbm):this()
|
|
{
|
|
//InitializeComponent();
|
|
this.gvJXXX.AutoGenerateColumns = false;
|
|
BindGv(htbm);
|
|
}
|
|
|
|
|
|
public void BindGv(int htbm)
|
|
{
|
|
//根据合同编码获取合同下有加项的信息
|
|
var vs = ServiceContainer.GetService<It_jjxb>();
|
|
List<dto_jxfz> ldj= vs.GetJxxxByHtbm(htbm);
|
|
this.gvJXXX.DataSource = null;
|
|
if (ldj != null && ldj.Count > 0)
|
|
{
|
|
this.gvJXXX.DataSource = ldj;
|
|
}
|
|
|
|
}
|
|
|
|
private void gvTJXX_CellClick(object sender, DataGridViewCellEventArgs e)
|
|
{
|
|
if (e.RowIndex < 0)
|
|
{
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
int rindex = e.RowIndex;
|
|
dto_jxfz dj = this.gvJXXX.Rows[rindex].DataBoundItem as dto_jxfz;
|
|
if (dj == null)
|
|
{
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
//根据tm获取加项信息
|
|
int tm = dj.tm;
|
|
var vsjxlist = ServiceContainer.GetService<It_jjxb>();
|
|
string result=vsjxlist.GetJxByTm(tm);
|
|
this.gvTJXX.DataSource = null;
|
|
if (string.IsNullOrEmpty(result))
|
|
{
|
|
}
|
|
else
|
|
{
|
|
try{
|
|
DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject<DataTable>(result);
|
|
this.gvTJXX.DataSource = dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("操作中发生异常");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|