BaoKai_202508-Wms-Jingwang..../Scada/FrmLoc.cs

126 lines
4.3 KiB
C#
Raw Normal View History

2025-08-24 09:35:55 +08:00
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;
using WMS.Business.Base;
using WMS.Business.Stock;
namespace Scada
{
public partial class FrmLoc : Form
{
public FrmLoc(string decd,string rowd)
{
InitializeComponent();
decid = decd;
row = rowd;
}
void BindData()
{
DataSet tb = IBussFactory<BussDecSts>.Instance().GetDecLocSts(decid, row);
if (tb != null)
{
if (tb.Tables.Count > 0)
{
gc1.DataSource = tb.Tables[0];
gc2.DataSource = tb.Tables[1];
gc3.DataSource = tb.Tables[2];
gc4.DataSource = tb.Tables[3];
gc5.DataSource = tb.Tables[4];
gc6.DataSource = tb.Tables[5];
}
}
}
string decid = string.Empty;
string row = string.Empty;
private void FrmLoc_Load(object sender, EventArgs e)
{
BindData();
}
private void gridView1_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
{
DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
if (e.RowHandle >= 0)
{
string category = view.GetRowCellDisplayText(e.RowHandle, "status");
if (category == "1")
{
e.Appearance.BackColor = Color.Pink;
}
string hasvlme = view.GetRowCellDisplayText(e.RowHandle, "HASVOLUME");
if (hasvlme == "1")
{
e.Appearance.BackColor = Color.Lime;
}
}
}
private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
{
DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
if (view.RowCount > 0)
{
if (view.FocusedRowHandle >= 0)
{
string locId = view.GetRowCellValue(view.FocusedRowHandle, "loc").ToString();
DataTable tb = IBussFactory<BussMIStock>.Instance().GetMisDataOut(locId,"","");
if (tb != null)
{
if (tb.Rows.Count > 0)
{
t_locId.Text = tb.Rows[0]["LOCATION_ID"].ToString();
t_hg.Text = tb.Rows[0]["HIGH"].ToString();
t_sheet.Text = tb.Rows[0]["PUTIN_ID"].ToString();
t_date.Text = tb.Rows[0]["WARE_DATE"].ToString();
t_dec.Text = tb.Rows[0]["GOODS_NAME"].ToString();
t_iyid.Text = tb.Rows[0]["GOODS_ID"].ToString();
t_qty.Text = tb.Rows[0]["SHELVES_NUM"].ToString();
}
else
{
t_locId.Text = "";
t_hg.Text = "";
t_sheet.Text = "";
t_date.Text = "";
t_dec.Text = "";
t_iyid.Text = "";
t_qty.Text = "";
}
}
}
}
}
private void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
{
DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
if (e.RowHandle >= 0)
{
string category = view.GetRowCellDisplayText(e.RowHandle, "status");
if (category == "0")
{
e.Appearance.BackColor = Color.Pink;
}
string hasvlme = view.GetRowCellDisplayText(e.RowHandle, "HASVOLUME");
if (hasvlme == "1")
{
e.Appearance.BackColor = Color.Lime;
}
}
}
}
}