180 lines
4.7 KiB
C#
180 lines
4.7 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.Threading.Tasks;
|
|||
|
|
using System.Windows.Forms;
|
|||
|
|
using WMS.Business.CK;
|
|||
|
|
using WMS.Business;
|
|||
|
|
using WMS.Common;
|
|||
|
|
using WMS.Frm.Base;
|
|||
|
|
using DevExpress.XtraEditors.Repository;
|
|||
|
|
using WMS.Model.CK;
|
|||
|
|
using WMS.Model.Stock;
|
|||
|
|
|
|||
|
|
namespace WMS.FrmCK
|
|||
|
|
{
|
|||
|
|
public partial class FormMesCkOrder : FormBase
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
#region 变量声明
|
|||
|
|
/// <summary>
|
|||
|
|
/// 通知单实体
|
|||
|
|
/// </summary>
|
|||
|
|
public OrdersModel or_Model = new OrdersModel();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 通知单实体集合
|
|||
|
|
/// </summary>
|
|||
|
|
public List<OrdersModel> or_List = new List<OrdersModel>();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 通知单物料明细实体
|
|||
|
|
/// </summary>
|
|||
|
|
public OrderDetailModel or_det_Model = new OrderDetailModel();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 通知单物料明细实体集合
|
|||
|
|
/// </summary>
|
|||
|
|
public List<OrderDetailModel> or_det_List = new List<OrderDetailModel>();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 修改前的物料明细实体集合
|
|||
|
|
/// </summary>
|
|||
|
|
public List<OrderDetailModel> oldor_det_List = new List<OrderDetailModel>();
|
|||
|
|
/// <summary>
|
|||
|
|
/// 选择仓库编号
|
|||
|
|
/// </summary>
|
|||
|
|
public string storage_id;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 所选库存物料
|
|||
|
|
/// </summary>
|
|||
|
|
public List<MIStockModel> mi_list = new List<MIStockModel>();
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 全选判断
|
|||
|
|
/// </summary>
|
|||
|
|
bool m_status = false;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// gridview 焦点行
|
|||
|
|
/// </summary>
|
|||
|
|
public int rowFocus = 0;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 单位
|
|||
|
|
/// </summary>
|
|||
|
|
private DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit lueUnits = new RepositoryItemLookUpEdit();
|
|||
|
|
/// <summary>
|
|||
|
|
/// 操作标志 0 新增,1 编辑
|
|||
|
|
/// </summary>
|
|||
|
|
int flg = 0;
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
public FormMesCkOrder()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void FormMesCkOrder_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
GetOrder();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
public override void Refresh()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
GetOrder();
|
|||
|
|
}
|
|||
|
|
private void GetOrder()
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
//if (frmVal != "0")
|
|||
|
|
//{
|
|||
|
|
// or_Model.Ck_type = frmVal;
|
|||
|
|
//}
|
|||
|
|
//or_Model.CREATE_DATE = System.DateTime.Now.AddDays(-15);
|
|||
|
|
|
|||
|
|
or_List = IBussFactory<BussOrders>.Instance().GetOrders(or_Model);
|
|||
|
|
if (or_List != null)
|
|||
|
|
{
|
|||
|
|
if (or_List.Count > 0)
|
|||
|
|
{
|
|||
|
|
or_Model = or_List[0];
|
|||
|
|
gridView1.FocusedRowHandle = 0;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
bindingSource1.DataSource = or_List;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowInfoMessageBox("网络连接错误!");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#region 绑定通知单明细
|
|||
|
|
/// <summary>
|
|||
|
|
/// 绑定通知单明细
|
|||
|
|
/// </summary>
|
|||
|
|
public void BindDetailData(string ORDER_ID)
|
|||
|
|
{
|
|||
|
|
if (or_Model != null)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
or_det_Model = new OrderDetailModel();
|
|||
|
|
//or_det_Model.BUSINESSID = or_Model.BUSINESSORDERID;
|
|||
|
|
or_det_Model.ORDER_ID = ORDER_ID;
|
|||
|
|
|
|||
|
|
or_det_List = IBussFactory<BussOrderDetail>.Instance().GetOrderDetail(or_det_Model);
|
|||
|
|
if (or_det_List != null)
|
|||
|
|
{
|
|||
|
|
if (or_det_List.Count > 0)
|
|||
|
|
{
|
|||
|
|
or_det_Model = or_det_List[0];
|
|||
|
|
}
|
|||
|
|
bindingSource2.DataSource = or_det_List;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowInfoMessageBox("网络连接错误!");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
|
|||
|
|
{
|
|||
|
|
if (gridView1.RowCount == 0)
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
if (gridView1.FocusedRowHandle < 0)
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
string ORDER_ID = gridView1.GetFocusedRowCellValue("ORDER_ID").ToString();
|
|||
|
|
BindDetailData(ORDER_ID);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|