GB_Data_Interface Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ServiceSide;
namespace DKS
{
public partial class GB_Data_Interface : Form
{
public GB_Data_Interface()
{
InitializeComponent();
}
ServiceSide.ServiceSide service = new ServiceSide.ServiceSide();
/// <summary>
/// 页面加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void GB_Data_Interface_Load(object sender, EventArgs e)
{
var res2 = service.GetPm();
if (res2.code == 200)
{
pm.DataSource = res2.data;
pm.DisplayMember = "pmms";
pm.ValueMember = "pmbh";
pm.Text = "";
}
else
{
MessageBox.Show(res2.message);
}
var res = service.Get_Gb_Data(ch.Text,pm.SelectedValue.ToString(),ly.Text,qx.Text,ycgb_sj.Text,ecgb_sj.Text);
if (res.code==200)
{
var ds = res.data as DataSet;
data_view.DataSource = ds.Tables[0];
DataView();
}
else
{
MessageBox.Show(res.message);
}
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void query_Click(object sender, EventArgs e)
{
var res = service.Get_Gb_Data(ch.Text, pm.SelectedValue.ToString(), ly.Text, qx.Text, ycgb_sj.Text, ecgb_sj.Text);
if (res.code==200)
{
var ds = res.data as DataSet;
data_view.DataSource = ds.Tables[0];
DataView();
}
else
{
MessageBox.Show(res.message);
}
}
/// <summary>
/// 设置表头
/// </summary>
private void DataView()
{
data_view.Columns[0].HeaderCell.Value = "称重序号";
data_view.Columns[1].HeaderCell.Value = "车号";
data_view.Columns[2].HeaderCell.Value = "品名";
data_view.Columns[3].HeaderCell.Value = "来源";
data_view.Columns[4].HeaderCell.Value = "去向";
data_view.Columns[5].HeaderCell.Value = "皮重地点";
data_view.Columns[6].HeaderCell.Value = "皮重司秤员";
data_view.Columns[7].HeaderCell.Value = "皮重时间";
data_view.Columns[8].HeaderCell.Value = "皮重";
data_view.Columns[9].HeaderCell.Value = "扣重";
data_view.Columns[10].HeaderCell.Value = "毛重地点";
data_view.Columns[11].HeaderCell.Value = "毛重司秤员";
data_view.Columns[12].HeaderCell.Value = "毛重时间";
data_view.Columns[13].HeaderCell.Value = "净重";
data_view.Columns[14].HeaderCell.Value = "数据状态";
data_view.Columns[15].HeaderCell.Value = "失效操作人";
data_view.Columns[16].HeaderCell.Value = "失效时间";
}
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Hide();
ImportData_Interface data = new ImportData_Interface();
data.ShowDialog();
this.Close();
}
}
}