using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using wcftest.BussinessExtension.Common;
using wcftest.orm;
namespace wcftest.BussinessExtension.Handle
{
///
/// 托盘处理类
///
public class PlateCodeHandler
{
///
/// 验证托盘号是否可以组盘
///
///
///
///
public static bool ValiatePlateIsAllowZP(string plateCode, ref string msg)
{
using (dbModel mod = new dbModel())
{
var obj = mod.Base_Plate.Where(x => x.PlateCode == plateCode).FirstOrDefault();
if (obj == null)
{
msg = "托盘号" + plateCode + "不存在";
return false;
}
//如果该托盘在货架上,则报错
var find_PositionName = SysGlole.PositionName_SHZCQ;
var aa = mod.Base_ProductPosition.Where(x => x.PlateCode == plateCode && (x.PositionName != find_PositionName && x.PositionName != "")).FirstOrDefault();
if (aa != null)
{
msg = "托盘号" + plateCode + "在库位'" + aa.PositionName + "'上,不允许操作";
return false;
}
}
return true;
}
}
}