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
{
///
/// 空查询
///
public SendPlanSearchEditForm()
{
InitializeComponent();
}
///
/// 带参数查询
///
///
public SendPlanSearchEditForm(string code)
{
InitializeComponent();
this.txtSendCode.Text = code;
}
///
/// 窗体加载
///
///
///
private void Form_Load(object sender, EventArgs e)
{
//初始化控件属性
this.DGView.AutoGenerateColumns = false;
if (!string.IsNullOrEmpty(this.txtSendCode.Text.Trim()))
{
SearchListBind();
}
}
///
/// 窗体关闭
///
///
///
private void tsbClose_Click(object sender, EventArgs e)
{
this.Close();
}
///
/// 查询
///
///
///
private void tsbSearch_Click(object sender, EventArgs e)
{
SearchListBind();
}
///
/// 查询方法
///
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 list = agent.InvokeServiceFunction>(B9IPCService.MainBLL_GetAllList.ToString(), searchModel);
this.DGView.DataSource = new List();
this.DGView.DataSource = list;
}
///
/// 打印
///
///
///
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);
}
}
}
}