天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.4 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using QM.Common;
using QMAPP.FJC.Entity;
using QMAPP.FJC.Entity.Basic;
using QMAPP.FJC.Entity.Operation;
using QMAPP.ServicesAgent;
using QMAPP.WinForm.Common;
namespace QMAPP.WinForm.Forms.SendPlan
{
public partial class SendPlanSearchEditForm : Form
{
/// <summary>
/// 空查询
/// </summary>
public SendPlanSearchEditForm()
{
InitializeComponent();
}
/// <summary>
/// 带参数查询
/// </summary>
/// <param name="pid"></param>
public SendPlanSearchEditForm(string code)
{
InitializeComponent();
this.txtSendCode.Text = code;
}
/// <summary>
/// 窗体加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form_Load(object sender, EventArgs e)
{
//初始化控件属性
this.DGView.AutoGenerateColumns = false;
if (!string.IsNullOrEmpty(this.txtSendCode.Text.Trim()))
{
SearchListBind();
}
}
/// <summary>
/// 窗体关闭
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void tsbClose_Click(object sender, EventArgs e)
{
this.Close();
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void tsbSearch_Click(object sender, EventArgs e)
{
SearchListBind();
}
/// <summary>
/// 查询方法
/// </summary>
private void SearchListBind() {
Main searchModel = new Main();
if (string.IsNullOrEmpty(this.txtSendCode.Text.Trim()) == false)
{
searchModel.SENDCODE = this.txtSendCode.Text.Trim();
}
if (string.IsNullOrEmpty(this.txtProCode.Text.Trim()) == false)
{
searchModel.publicCode = this.txtProCode.Text.Trim();
}
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
List<Main> list = agent.InvokeServiceFunction<List<Main>>(B9IPCService.MainBLL_GetAllList.ToString(), searchModel);
this.DGView.DataSource = new List<Main>();
this.DGView.DataSource = list;
}
/// <summary>
/// 打印
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void tsbPrint_Click(object sender, EventArgs e)
{
if (this.DGView.SelectedRows.Count <= 0)
return;
string barCode = this.DGView.SelectedRows[0].Cells["SENDCODE"].Value.ToString(); ;
string xmlPath = @"E:\富维江森\代码\B9\APPB9\QMAPP.WinForm\XMLResources\SendInfo.xml";
BarcodeLib.BarCodeGenerate generate = new BarcodeLib.BarCodeGenerate(xmlPath);
generate.PrintBarCode(barCode);
}
private void SendPlanSearchEditForm_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.tsbSearch_Click(sender, e);
}
}
}
}