162 lines
5.3 KiB
C#
162 lines
5.3 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel;
|
||
using System.Configuration;
|
||
using System.Data;
|
||
using System.Drawing;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
using System.Windows.Forms;
|
||
using WMS.Business;
|
||
using WMS.Business.Base;
|
||
using WMS.Business.Stock;
|
||
using WMS.Common;
|
||
using WMS.Frm.Base;
|
||
using WMS.Model.Base;
|
||
using WMS.Model.Stock;
|
||
|
||
namespace WMS.FrmStock
|
||
{
|
||
public partial class FrmAreaRep : FormBase
|
||
{
|
||
public FrmAreaRep()
|
||
{
|
||
InitializeComponent();
|
||
}
|
||
string outStand = "";
|
||
private void FrmAreaRep_Load(object sender, EventArgs e)
|
||
{
|
||
BindDataInce();
|
||
BindData();
|
||
///outStand = ConfigurationManager.ConnectionStrings["outStand"].ConnectionString;
|
||
}
|
||
void BindDataInce()
|
||
{
|
||
DataTable tb = IBussFactory<BussAdjustListInfo>.Instance().GetIncertory();
|
||
if (tb != null)
|
||
{
|
||
GCMiStock.DataSource = tb;
|
||
}
|
||
}
|
||
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
|
||
}
|
||
|
||
private void ctrlButtons4_Click(object sender, EventArgs e)
|
||
{
|
||
if (gridView4.RowCount > 0)
|
||
{
|
||
int[] ctSelect = gridView4.GetSelectedRows();
|
||
|
||
if (ctSelect.Length > 1)
|
||
{
|
||
MessageBox.Show("不能同时盘点多个库位物料");
|
||
return;
|
||
}
|
||
for (int i = 0; i < ctSelect.Length; i++)
|
||
{
|
||
string loc = gridView4.GetRowCellValue(ctSelect[i], "LOCATION_ID").ToString();
|
||
|
||
DialogResult dia = MessageBox.Show("确定对货位:"+ loc+" 盘点出库操作吗?", "系统提示",
|
||
MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
|
||
if (dia == System.Windows.Forms.DialogResult.OK)
|
||
{
|
||
string station = "";// gridView4.GetRowCellValue(ctSelect[i], "outStand2").ToString();
|
||
////取1,4排货物 ,判断2,3排是否有货
|
||
|
||
|
||
if (loc.Substring(0, 2) == "01" || loc.Substring(0, 2) == "02")
|
||
{
|
||
station = "114";
|
||
}
|
||
else if (loc.Substring(0, 2) == "03" || loc.Substring(0, 2) == "04")
|
||
{
|
||
station = "214";
|
||
}
|
||
|
||
|
||
|
||
//string row = loc.Substring(0, 1).ToString();
|
||
//string cln = loc.Substring(1, 2).ToString();
|
||
//string layer = loc.Substring(3, 2).ToString();
|
||
|
||
//if (row == "1" || row == "4")
|
||
//{
|
||
// string strloc = string.Empty;
|
||
// if (row == "1")
|
||
// {
|
||
// strloc = "2" + cln + layer + "1";
|
||
// }
|
||
// else if (row == "4")
|
||
// {
|
||
// strloc = "3" + cln + layer + "1";
|
||
// }
|
||
// string strLoction = IBussFactory<BussAdjustListInfo>.Instance().Get_StrLoc(strloc);
|
||
// if (strLoction.Length > 0)
|
||
// {
|
||
// MessageBox.Show("库位:" + strLoction + " 有货,不能对货位:" + loc + " 进行出库");
|
||
// return;
|
||
// }
|
||
//}
|
||
|
||
IBussFactory<BussAdjustListInfo>.Instance().AddInvertory(loc, station);
|
||
}
|
||
}
|
||
BindDataInce();
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
string locid = string.Empty;
|
||
void BindData()
|
||
{
|
||
DataTable dt = IBussFactory<BussMIStock>.Instance().GetMistockLocData("");
|
||
if (dt != null)
|
||
{
|
||
List<MIStockModel> MIStock = ConvertHelper<MIStockModel>.ConvertToList(dt);
|
||
|
||
//bindingSource1.DataSource = locData;
|
||
gridControlCustom2.DataSource= MIStock;
|
||
}
|
||
|
||
}
|
||
List<BussMIStock> locData = new List<BussMIStock>();
|
||
private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
|
||
{
|
||
//if (comboBox1.Text == "全部")
|
||
//{
|
||
// BindData();
|
||
//}
|
||
//else
|
||
//{
|
||
// string locId = comboBox1.Text;
|
||
// locData = IBussFactory<BussMIStock>.Instance().GetMistockLocData(locId);
|
||
// if (locData != null)
|
||
// {
|
||
// bindingSource1.DataSource = locData;
|
||
// }
|
||
//}
|
||
}
|
||
|
||
private void timer1_Tick(object sender, EventArgs e)
|
||
{
|
||
BindDataInce();
|
||
}
|
||
|
||
private void ctrlButtons7_Click(object sender, EventArgs e)
|
||
{
|
||
BindDataInce();
|
||
|
||
}
|
||
|
||
private void groupBox1_Enter(object sender, EventArgs e)
|
||
{
|
||
|
||
}
|
||
}
|
||
}
|