| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm.Control;
- using CoreFS.CA06;
- using Pur.Entity.ck;
- using Pur.Entity.configureEntity;
- using Pur.Entity;
- using com.hnshituo.pur.vo;
- namespace Pur.Pop_upWindow
- {
- public partial class frmPopInStockQtyDetail : FrmPmsBase
- {
- private string itemUnique;
- private string tabShow="0";
- public frmPopInStockQtyDetail()
- {
- InitializeComponent();
- }
- public frmPopInStockQtyDetail(OpeBase OB,String strItemUnique,string TabShow)
- {
- this.ob = OB;
- if (String.IsNullOrEmpty(strItemUnique))
- {
- MessageBox.Show("未选择物料!");
- }
- itemUnique = strItemUnique;
- tabShow = TabShow;
- InitializeComponent();
- }
- private void frmPopInStockQtyDetail_Load(object sender, EventArgs e)
- {
- init();
- }
- /// <summary>
- /// 初始化数据
- /// </summary>
- private void init()//初始化数据
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- //默认选择的数tab
- if (tabShow == "0")
- {
- ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[0];
- }
- else
- {
- ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[1];
- }
- //查看库存
- dataTable1.Clear();
- CkStorage CkSto = new CkStorage();
- CkSto.Validflag = "1";
- CkSto.ItemUnique = itemUnique;
- CkSto.InvOrigQty = 0.0;
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkStorageService", "find_Storage", new object[] { CkSto });
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
-
- //查看在途库存
- dataTable2.Clear();
- OrderC orderc = new OrderC();
- orderc.ItemUnique = itemUnique;
- orderc.Validflag = "1";
- orderc.DeleteName = "1";//仅查询在途库存大于0的
- DataTable dt11 = this.execute<DataTable>("com.hnshituo.pur.order.service.OrderCService", "doQueryOrderC", new object[] { orderc });
- GridHelper.CopyDataToDatatable(dt11, dataTable2, true);
- //查看物料
- string[] str = itemUnique.Split('@');
- String stritemCode = str[0];
- string stritemAttrId = str[1];
- string stritemstandardsId = str[2];
- string stritemUomId = str[3];
- if (!String.IsNullOrEmpty(stritemCode))
- {
- MatEntity mat = this.execute<MatEntity>("com.hnshituo.pur.configure.service.MatService", "findById", new object[] { stritemCode });
- if (mat != null)
- {
- txt_itemCode.Text = mat.ItemCode == null ? "" : mat.ItemCode;
- txt_itemName.Text = mat.ItemName == null ? "" : mat.ItemName;
- }
-
- }
- if (!string.IsNullOrEmpty(stritemAttrId))
- {
- PurMatAttrsEntity matAttr = this.execute<PurMatAttrsEntity>("com.hnshituo.pur.configure.service.MatAttrsService", "findById", new object[] { stritemAttrId });
- if (matAttr != null)
- {
- txt_itemAttr.Text = matAttr.ItemAttr == null ? "" : matAttr.ItemAttr;
- txt_itemAttrId.Text = matAttr.ItemAttrId == null ? "" : matAttr.ItemAttrId;
- }
- }
- if (!string.IsNullOrEmpty(stritemstandardsId))
- {
- PurStandardsEntity matStandards = this.execute<PurStandardsEntity>("com.hnshituo.pur.configure.service.MatStandardsService", "findById", new object[] { stritemstandardsId });
- if (matStandards != null)
- {
- txt_itemStandardsId.Text = matStandards.StandardsId == null ? "" : matStandards.StandardsId;
- txt_itemStandCode.Text = matStandards.StandardsCode == null ? "" : matStandards.StandardsCode;
- }
- }
- if (!string.IsNullOrEmpty(stritemUomId))
- {
- PurMatUomsEntity matUom = this.execute<PurMatUomsEntity>("com.hnshituo.pur.configure.service.MatUomsService", "findById", new object[] { stritemUomId });
- if (matUom != null)
- {
-
- }
- }
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- /// <summary>
- /// 刷新数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btn_refresh_Click(object sender, EventArgs e)//刷新数据
- {
- init();
- }
- }
- }
|