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.
662 lines
26 KiB
662 lines
26 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Data.Linq;
|
|
using System.Linq;
|
|
using System.Drawing;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using DevExpress.XtraEditors;
|
|
using DevExpress.XtraGrid.Views.BandedGrid;
|
|
using DevExpress.XtraGrid.Columns;
|
|
using DevExpress.XtraGrid;
|
|
using System.IO;
|
|
using System.Threading;
|
|
using ICSSoft.Base.Language.Tool;
|
|
using ICSSoft.Base.Config.AppConfig;
|
|
using ICSSoft.Base.UserControl.MessageControl;
|
|
using ICSSoft.Base.Config.DBHelper;
|
|
using ICSSoft.Base.Report.Filter;
|
|
using ICSSoft.Base.UserControl.FormControl;
|
|
using ICSSoft.Base.Report.GridReport;
|
|
using ICSSoft.Base.ReferForm.AppReferForm;
|
|
using ICSSoft.Frame.Data.BLL;
|
|
using ICSSoft.Frame.Data.Entity;
|
|
using ICSSoft.Base.Lable.PrintTool;
|
|
|
|
namespace ICSSoft.Frame.APP
|
|
{
|
|
public partial class FormICSOWarehousingLOT : DevExpress.XtraEditors.XtraForm
|
|
{
|
|
private string sqltxt = "";
|
|
private string sqlconn = "";
|
|
String guid = AppConfig.GetGuid();
|
|
private DataTable dataSource = null;
|
|
private string MoId = "";
|
|
private string POCode = "";
|
|
private decimal Qty = 0.00m;
|
|
DataTable Serialdata = null;
|
|
private string Type = "";
|
|
private string Batch = "";
|
|
private string Status = "";
|
|
|
|
#region 构造函数
|
|
public FormICSOWarehousingLOT()
|
|
{
|
|
InitializeComponent();
|
|
this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
|
|
this.WindowState = FormWindowState.Maximized;
|
|
|
|
}
|
|
public FormICSOWarehousingLOT(string moID, string POCode, decimal qty)
|
|
{
|
|
InitializeComponent();
|
|
this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
|
|
this.WindowState = FormWindowState.Maximized;
|
|
MoId = moID;
|
|
POCode = POCode;
|
|
Qty = qty;
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region 操作权限
|
|
public DataTable RightOfExute()
|
|
{
|
|
DataTable rData = new DataTable();
|
|
rData.Columns.Add("BtnName");
|
|
rData.Columns.Add("ActionName");
|
|
//查看权限(必须有)
|
|
DataRow seeRow = rData.NewRow();
|
|
seeRow["BtnName"] = "see";
|
|
seeRow["ActionName"] = "查看";
|
|
rData.Rows.Add(seeRow);
|
|
|
|
List<Control> ControlList = new List<Control>();
|
|
ControlList.Add(btnCreate);
|
|
ControlList.Add(btnDel);
|
|
ControlList.Add(simpleButton4);
|
|
foreach (Control ctr in ControlList)
|
|
{
|
|
|
|
if (ctr.GetType() == typeof(SimpleButton))
|
|
{
|
|
DataRow dr = rData.NewRow();
|
|
dr["BtnName"] = ctr.Name;
|
|
dr["ActionName"] = ctr.Text;
|
|
rData.Rows.Add(dr);
|
|
}
|
|
}
|
|
|
|
rData.AcceptChanges();
|
|
return rData;
|
|
}
|
|
public DataTable RightOfData()// 数据权限
|
|
{
|
|
DataTable rData = new DataTable();
|
|
rData.Columns.Add("BodyName");
|
|
rData.Columns.Add("ControlName");
|
|
rData.Columns.Add("ControlCaption");
|
|
|
|
rData.AcceptChanges();
|
|
return rData;
|
|
}
|
|
#endregion
|
|
|
|
#region 退出
|
|
private void btnClose_Click(object sender, EventArgs e)
|
|
{
|
|
AppConfig.CloseFormShow(this.Text);
|
|
this.Close();
|
|
}
|
|
|
|
private void btnExit_Click(object sender, EventArgs e)
|
|
{
|
|
AppConfig.CloseFormShow(this.Text);
|
|
this.Close();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 移动窗体
|
|
private const int WM_NCHITTEST = 0x84;
|
|
private const int HTCLIENT = 0x1;
|
|
private const int HTCAPTION = 0x2;
|
|
//首先必须了解Windows的消息传递机制,当有鼠标活动消息时,
|
|
//系统发送WM_NCHITTEST 消息给窗体作为判断消息发生地的根据。 nchittest
|
|
//假如你点击的是标题栏,窗体收到的消息值就是 HTCAPTION ,
|
|
//同样地,若接受到的消息是 HTCLIENT,说明用户点击的是客户区,也就是鼠标消息发生在客户区。
|
|
|
|
//重写窗体,使窗体可以不通过自带标题栏实现移动
|
|
protected override void WndProc(ref Message m)
|
|
{
|
|
//当重载窗体的 WndProc 方法时,可以截获 WM_NCHITTEST 消息并改些该消息,
|
|
//当判断鼠标事件发生在客户区时,改写改消息,发送 HTCAPTION 给窗体,
|
|
//这样,窗体收到的消息就时 HTCAPTION ,在客户区通过鼠标来拖动窗体就如同通过标题栏来拖动一样。
|
|
//注意:当你重载 WndProc 并改写鼠标事件后,整个窗体的鼠标事件也就随之改变了。
|
|
switch (m.Msg)
|
|
{
|
|
case WM_NCHITTEST:
|
|
base.WndProc(ref m);
|
|
if ((int)m.Result == HTCLIENT)
|
|
m.Result = (IntPtr)HTCAPTION;
|
|
return;
|
|
}
|
|
//拦截双击标题栏、移动窗体的系统消息
|
|
if (m.Msg != 0xA3)
|
|
{
|
|
base.WndProc(ref m);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 列表
|
|
private void grvDetail_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
|
|
{
|
|
if (e.Info.IsRowIndicator && e.RowHandle >= 0)
|
|
e.Info.DisplayText = (e.RowHandle + 1).ToString();
|
|
}
|
|
#endregion
|
|
|
|
#region 分页
|
|
private void rptPage_PageIndexChanged(object Sender, EventArgs e)
|
|
{
|
|
|
|
DataTable data = AppConfig.GetPageData(Serialdata, rptPage.PageIndex, rptPage.PageSize).Copy();
|
|
grdDetail.DataSource = data;
|
|
}
|
|
#endregion
|
|
|
|
private bool check()
|
|
{
|
|
int i;
|
|
if (string.IsNullOrWhiteSpace(txtPOCode.Text.Trim()))
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("单据号不能为空!");
|
|
return false;
|
|
}
|
|
if (string.IsNullOrWhiteSpace(PORow.Text.Trim()))
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("行号不能为空!");
|
|
return false;
|
|
}
|
|
else if(!int.TryParse(PORow.Text.Trim(),out i))
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("行号格式不正确!");
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
#region 生成
|
|
private void btnCreate_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
SimpleButton btntemp = (SimpleButton)sender;
|
|
if (AppConfig.GetUserExcuteRight(this.Tag.ToString(), btntemp.Name) == false)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("对不起您没有:" + btntemp.Text + "权限,请联系系统管理员!");
|
|
return;
|
|
}
|
|
if (Status.Equals("已经完成"))
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("物料条码已存在!");
|
|
return;
|
|
}
|
|
//if (!check())
|
|
//{
|
|
// return;
|
|
//}
|
|
//FormICSOWarehousing form = new FormICSOWarehousing(txtPOCode.Text.Trim(), PORow.Text.Trim(), txtINVSTD.Text, Batch);
|
|
//form.ShowDialog();
|
|
//cmbSEQ_SelectedIndexChanged(null, null);
|
|
|
|
string moSeq = "";
|
|
string moCode = "";
|
|
string invStd = "";
|
|
for (int i = 0; i < grvMoDetail.RowCount; i++)
|
|
{
|
|
if (grvMoDetail.GetRowCellValue(i, colMoIsSelect).ToString() == "Y")
|
|
{
|
|
moSeq = grvMoDetail.GetRowCellValue(i, colMOSEQ1).ToString();
|
|
moCode = grvMoDetail.GetRowCellValue(i, colMoCode1).ToString();
|
|
invStd = grvMoDetail.GetRowCellValue(i, colINVSTD).ToString();
|
|
}
|
|
}
|
|
if (string.IsNullOrWhiteSpace(moSeq))
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("请选择数据");
|
|
return;
|
|
}
|
|
|
|
FormICSOWarehousing form = new FormICSOWarehousing(moCode, moSeq, invStd, Type);
|
|
form.ShowDialog();
|
|
SearchData(moCode, moSeq);
|
|
|
|
if(ICSBaseSimpleCode.AppshowMessageBoxRepose("是否打印?") == DialogResult.OK)
|
|
{
|
|
simpleButton4_Click(null, null);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox(ex.ToString());
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取生成的条码
|
|
/// </summary>
|
|
/// <param name="moCode"></param>
|
|
/// <param name="moSeq"></param>
|
|
private void SearchData(string moCode, string moSeq)
|
|
{
|
|
|
|
try
|
|
{
|
|
DataSet ds = ICSOWarehousingLOTBLL.SearchData(moCode, moSeq, AppConfig.AppConnectString);
|
|
if (ds != null && ds.Tables.Count == 2)
|
|
{
|
|
DataTable dt = ds.Tables[0];
|
|
Serialdata = ds.Tables[1];
|
|
grdDetail.DataSource = Serialdata;
|
|
grvDetail.BestFitColumns();
|
|
rptPage.RecordNum = Serialdata.Rows.Count;
|
|
rptPage.PageSize = 499;
|
|
rptPage.PageIndex = 1;
|
|
rptPage.ReLoad();
|
|
rptPage.PageSize = 500;
|
|
rptPage.PageIndex = 1;
|
|
rptPage.ReLoad();
|
|
rptPage_PageIndexChanged(null, null);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox(ex.ToString());
|
|
}
|
|
}
|
|
#endregion
|
|
//加载
|
|
private void FormICSOWarehousingLOT_Load(object sender, EventArgs e)
|
|
{
|
|
#region
|
|
//string sql = @"select '' as isSelect,RCARD from ICSMO2RCARD where MOID='{0}' order by RCARD asc";
|
|
//sql = string.Format(sql, MoId);
|
|
////DataTable dt = DBHelper.ExecuteDataset(AppConfig.AppConnectString, CommandType.Text, sql).Tables[0];
|
|
////grdDetail.DataSource = dt;
|
|
//Serialdata = DBHelper.ExecuteDataset(AppConfig.AppConnectString, CommandType.Text, sql).Tables[0];
|
|
//rptPage.RecordNum = Serialdata.Rows.Count;
|
|
//rptPage.PageIndex = 1;
|
|
//rptPage.PageSize = 20;
|
|
//rptPage.ReLoad();
|
|
//rptPage_PageIndexChanged(null, null);
|
|
#endregion
|
|
init();
|
|
}
|
|
|
|
#region 初始化查询条件
|
|
private void init()
|
|
{
|
|
#region 单据号
|
|
#region 原逻辑
|
|
//string sql = "SELECT DISTINCT ReceiptNO AS [单据号] FROM ICSINVReceipt WHERE WorkPoint='{0}' ORDER BY ReceiptNO ";
|
|
#endregion
|
|
string sql = "SELECT DISTINCT cCode AS [单据号] FROM ICSRdrecord09s WHERE Free3='入' ORDER BY cCode";
|
|
sql = string.Format(sql);
|
|
DataTable dt = DBHelper.ExecuteDataset(AppConfig.AppConnectString.ToString(), CommandType.Text, sql).Tables[0];
|
|
txtPOCode.Properties.ValueMember = "单据号";
|
|
txtPOCode.Properties.DisplayMember = "单据号";
|
|
txtPOCode.Properties.DataSource = dt;
|
|
txtPOCode.Properties.NullText = "";//空时的值
|
|
txtPOCode.Properties.ImmediatePopup = true;//输入值是否马上弹出窗体
|
|
txtPOCode.Properties.ValidateOnEnterKey = true;//回车确认
|
|
txtPOCode.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;//要使用户可以输入,这里须设为Standard
|
|
txtPOCode.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; //可用Ctrl + Delete清空选择內容
|
|
//自适应宽度
|
|
txtPOCode.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
|
|
#endregion
|
|
}
|
|
#endregion
|
|
|
|
private void txtMOCode_EditValueChanged(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
//this.txtInvCode.Text = "";
|
|
//this.txtINVNAME.Text = "";
|
|
//this.txtINVSTD.Text = "";
|
|
//this.txtQuantity.Text = "";
|
|
//grdDetail.DataSource = null;
|
|
//PORow.Properties.Items.Clear();
|
|
//PORow.Text = "";
|
|
//string Code = txtPOCode.EditValue.ToString();
|
|
//string sql = "SELECT DISTINCT iRSRowNO FROM ICSRdrecord09s WHERE cCode='{0}' AND free3='入' ORDER BY iRSRowNO";//行号
|
|
//sql = string.Format(sql, Code);
|
|
//DataTable dt = DBHelper.ExecuteDataset(AppConfig.AppConnectString.ToString(), CommandType.Text, sql).Tables[0];
|
|
//foreach( DataRow dr in dt.Rows)
|
|
//{
|
|
// PORow.Properties.Items.Add(dr["iRSRowNO"].ToString());
|
|
//}
|
|
//if (PORow.Properties.Items.Count > 0)
|
|
// PORow.SelectedIndex = 0;
|
|
|
|
grdDetail.DataSource = null;
|
|
string Code = txtPOCode.EditValue.ToString();
|
|
string sql = @"SELECT '' as MoIsSelect,
|
|
a.cCode MOCODE,
|
|
a.iRSRowNO MOSEQ,
|
|
a.iQuantity MOPLANQTY,
|
|
a.cInvCode ITEMCODE,
|
|
b.INVNAME,
|
|
b.INVSTD,b.INVCLASS,b.INVDESC
|
|
FROM
|
|
ICSRdrecord09s a
|
|
LEFT JOIN ICSINVENTORY b ON a.cInvCode=b.INVCODE
|
|
WHERE
|
|
a.cCode='{0}'
|
|
AND Free3='入'
|
|
AND b.WorkPoint = '{1}'";
|
|
sql += " order by CAST(a.iRSRowNO AS INT) asc";
|
|
sql = string.Format(sql, Code, AppConfig.WorkPointCode);
|
|
DataTable dt = DBHelper.ExecuteDataset(AppConfig.AppConnectString.ToString(), CommandType.Text, sql).Tables[0];
|
|
grdMoDetail.DataSource = dt;
|
|
grvMoDetail.BestFitColumns();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("没有找到该单据信息!");
|
|
return;
|
|
}
|
|
}
|
|
|
|
private void cmbSEQ_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
Type = "";
|
|
Status = "";
|
|
if (PORow.Properties.Items.Count <= 0 || !check())
|
|
{
|
|
return;
|
|
}
|
|
DataSet ds = ICSOWarehousingLOTBLL.SearchData(txtPOCode.Text.Trim(), PORow.Text.Trim(), AppConfig.AppConnectString);
|
|
if (ds != null && ds.Tables.Count == 2 )
|
|
{
|
|
DataTable dt = ds.Tables[0];
|
|
if (dt != null && dt.Rows.Count > 0)
|
|
{
|
|
txtInvCode.Text = dt.Rows[0]["cInvCode"].ToString();
|
|
txtINVNAME.Text = dt.Rows[0]["INVNAME"].ToString();
|
|
txtINVSTD.Text = dt.Rows[0]["INVSTD"].ToString();
|
|
txtQuantity.Text = dt.Rows[0]["iQuantity"].ToString();
|
|
Batch = dt.Rows[0]["cBatch"].ToString();
|
|
}
|
|
Serialdata = ds.Tables[1];
|
|
grdDetail.DataSource = Serialdata;
|
|
grvDetail.BestFitColumns();
|
|
rptPage.RecordNum = Serialdata.Rows.Count;
|
|
rptPage.PageSize = 499;
|
|
rptPage.PageIndex = 1;
|
|
rptPage.ReLoad();
|
|
rptPage.PageSize = 500;
|
|
rptPage.PageIndex = 1;
|
|
rptPage.ReLoad();
|
|
rptPage_PageIndexChanged(null, null);
|
|
}
|
|
else
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox(ex.ToString());
|
|
}
|
|
}
|
|
|
|
private void grvDetail_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
|
|
{
|
|
if (e.RowHandle >= 0 && e.Column.FieldName == "DCTCODE")
|
|
{
|
|
e.CellValue = "cccc";
|
|
}
|
|
}
|
|
|
|
#region 全选
|
|
private void btnSelectAll_Click(object sender, EventArgs e)
|
|
{
|
|
grvDetail.PostEditor();
|
|
this.Validate();
|
|
for (int i = 0; i < grvDetail.RowCount; i++)
|
|
{
|
|
grvDetail.SetRowCellValue(i, colisSelect, "Y");
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 全消
|
|
private void btnCancelAll_Click(object sender, EventArgs e)
|
|
{
|
|
grvDetail.PostEditor();
|
|
this.Validate();
|
|
for (int i = 0; i < grvDetail.RowCount; i++)
|
|
{
|
|
grvDetail.SetRowCellValue(i, colisSelect, "");
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
private void btnDel_Click(object sender, EventArgs e)
|
|
{
|
|
SimpleButton btntemp = (SimpleButton)sender;
|
|
if (AppConfig.GetUserExcuteRight(this.Tag.ToString(), btntemp.Name) == false)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("对不起您没有:" + btntemp.Text + "权限,请联系系统管理员!");
|
|
return;
|
|
}
|
|
List<string> rcardList = new List<string>();
|
|
for (int i = 0; i < grvDetail.RowCount; i++)
|
|
{
|
|
if (grvDetail.GetRowCellValue(i, colisSelect).ToString() == "Y" && grvDetail.GetRowCellValue(i, colisInput).ToString() == "False")
|
|
{
|
|
rcardList.Add(grvDetail.GetRowCellValue(i, colID).ToString());
|
|
}
|
|
}
|
|
if (rcardList.Count == 0 || rcardList == null)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("请选择数据");
|
|
return;
|
|
}
|
|
if (ICSBaseSimpleCode.AppshowMessageBoxRepose("确定删除序列号吗?删除后无法恢复,确定吗?") != DialogResult.OK)
|
|
{
|
|
btnCancelAll_Click(sender, e);
|
|
return;
|
|
}
|
|
try
|
|
{
|
|
ICSOWarehousingLOTBLL.deleteInfo(rcardList, AppConfig.AppConnectString);
|
|
ICSBaseSimpleCode.AppshowMessageBox("删除成功");
|
|
|
|
string moSeq = "";
|
|
string moCode = "";
|
|
for (int i = 0; i < grvMoDetail.RowCount; i++)
|
|
{
|
|
if (grvMoDetail.GetRowCellValue(i, colMoIsSelect).ToString() == "Y")
|
|
{
|
|
moSeq = grvMoDetail.GetRowCellValue(i, colMOSEQ1).ToString();
|
|
moCode = grvMoDetail.GetRowCellValue(i, colMoCode1).ToString();
|
|
}
|
|
}
|
|
SearchData(moCode, moSeq);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox(ex.Message);
|
|
}
|
|
cmbSEQ_SelectedIndexChanged(null, null);
|
|
}
|
|
|
|
private void grvDetail_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
if (grvDetail.FocusedRowHandle < 0)
|
|
{
|
|
return;
|
|
}
|
|
if (grvDetail.FocusedColumn == colisSelect)
|
|
{
|
|
if (grvDetail.GetRowCellValue(grvDetail.FocusedRowHandle, colisSelect).ToString() == "")
|
|
{
|
|
grvDetail.SetRowCellValue(grvDetail.FocusedRowHandle, colisSelect, "Y");
|
|
}
|
|
else
|
|
{
|
|
grvDetail.SetRowCellValue(grvDetail.FocusedRowHandle, colisSelect, "");
|
|
}
|
|
}
|
|
}
|
|
|
|
#region 打印
|
|
private void simpleButton4_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (sender != null)
|
|
{
|
|
SimpleButton btntemp = (SimpleButton)sender;
|
|
if (AppConfig.GetUserExcuteRight(this.Tag.ToString(), btntemp.Name) == false)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("对不起您没有:" + btntemp.Text + "权限,请联系系统管理员!");
|
|
return;
|
|
}
|
|
}
|
|
List<PrintPara> parasList = new List<PrintPara>();
|
|
List<ICSITEMLot> InfoList = new List<ICSITEMLot>();
|
|
for (int i = 0; i < grvDetail.RowCount; i++)
|
|
{
|
|
if (grvDetail.GetRowCellValue(i, colisSelect).ToString() == "Y")
|
|
{
|
|
PrintPara para = new PrintPara();
|
|
para.PrintKey = "LOTNO";
|
|
para.PrintValues = new object[] { grvDetail.GetRowCellValue(i, colLOTNO).ToString() };
|
|
parasList.Add(para);
|
|
ICSITEMLot Info = new ICSITEMLot();
|
|
Info.LotNO = grvDetail.GetRowCellValue(i, colLOTNO).ToString();
|
|
Info.lastPrintUSERID = AppConfig.UserId;
|
|
Info.lastPrintTime = AppConfig.GetSeverDateTime("yyyy-MM-dd hh:mm:ss");
|
|
Info.WorkPoint = AppConfig.WorkPointCode;
|
|
InfoList.Add(Info);
|
|
}
|
|
}
|
|
if (parasList.Count == 0)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox("请选择数据!");
|
|
return;
|
|
}
|
|
#region 修改打印模板逻辑
|
|
#region
|
|
//if (Type.Equals("半成品"))
|
|
//{
|
|
// FormPrintDialog f = new FormPrintDialog("007", this.Text, parasList, false, null);
|
|
// f.ShowDialog();
|
|
//}
|
|
//else if (Type.Equals("成品"))
|
|
//{
|
|
// FormPrintDialog f = new FormPrintDialog("008", this.Text, parasList, false, null);
|
|
// f.ShowDialog();
|
|
//}
|
|
#endregion
|
|
FormPrintDialog f = new FormPrintDialog("001", this.Text, parasList, false, null);
|
|
f.ShowDialog();
|
|
#endregion
|
|
//更新打印信息
|
|
ICSOWarehousingLOTBLL.updatePrint(InfoList, AppConfig.AppConnectString);
|
|
string moSeq = "";
|
|
string moCode = "";
|
|
for (int i = 0; i < grvMoDetail.RowCount; i++)
|
|
{
|
|
if (grvMoDetail.GetRowCellValue(i, colMoIsSelect).ToString() == "Y")
|
|
{
|
|
moSeq = grvMoDetail.GetRowCellValue(i, colMOSEQ1).ToString();
|
|
moCode = grvMoDetail.GetRowCellValue(i, colMoCode1).ToString();
|
|
}
|
|
}
|
|
SearchData(moCode, moSeq);
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show(ex.ToString());
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
private void grdMoDetail_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
|
|
int x = 0;
|
|
if (grvMoDetail.FocusedRowHandle < 0)
|
|
{
|
|
return;
|
|
}
|
|
if (grvMoDetail.FocusedColumn == colMoIsSelect)
|
|
{
|
|
if (grvMoDetail.GetRowCellValue(grvMoDetail.FocusedRowHandle, colMoIsSelect).ToString() == "")
|
|
{
|
|
grvMoDetail.SetRowCellValue(grvMoDetail.FocusedRowHandle, colMoIsSelect, "Y");
|
|
x = grvMoDetail.FocusedRowHandle;
|
|
}
|
|
else
|
|
{
|
|
grvMoDetail.SetRowCellValue(grvMoDetail.FocusedRowHandle, colMoIsSelect, "");
|
|
}
|
|
}
|
|
for (int i = 0; i < grvMoDetail.RowCount; i++)
|
|
{
|
|
if (x != i)
|
|
{
|
|
grvMoDetail.SetRowCellValue(i, colMoIsSelect, "");
|
|
}
|
|
}
|
|
|
|
try
|
|
{
|
|
Type = "";
|
|
Status = "";
|
|
string moSeq = "";
|
|
string moCode = "";
|
|
for (int i = 0; i < grvMoDetail.RowCount; i++)
|
|
{
|
|
if (grvMoDetail.GetRowCellValue(i, colMoIsSelect).ToString() == "Y")
|
|
{
|
|
moSeq = grvMoDetail.GetRowCellValue(i, colMOSEQ1).ToString();
|
|
moCode = grvMoDetail.GetRowCellValue(i, colMoCode1).ToString();
|
|
}
|
|
}
|
|
DataSet ds = ICSOWarehousingLOTBLL.SearchData(moCode, moSeq, AppConfig.AppConnectString);
|
|
if (ds != null && ds.Tables.Count == 2)
|
|
{
|
|
DataTable dt = ds.Tables[0];
|
|
Serialdata = ds.Tables[1];
|
|
grdDetail.DataSource = Serialdata;
|
|
grvDetail.BestFitColumns();
|
|
rptPage.RecordNum = Serialdata.Rows.Count;
|
|
rptPage.PageSize = 499;
|
|
rptPage.PageIndex = 1;
|
|
rptPage.ReLoad();
|
|
rptPage.PageSize = 500;
|
|
rptPage.PageIndex = 1;
|
|
rptPage.ReLoad();
|
|
rptPage_PageIndexChanged(null, null);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ICSBaseSimpleCode.AppshowMessageBox(ex.ToString());
|
|
}
|
|
}
|
|
}
|
|
}
|