米其林项目Giraf的新接口,采用WebAPI形式,会应用在上海玉兰,印度米其林及波兰米其林项目中
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.4 KiB

using WMS_GIRAF_Interface.Data;
using WMS_GIRAF_Interface.Entities;
using WMS_GIRAF_Interface.Repositories.Interface;
namespace WMS_GIRAF_Interface.Repositories.Implement;
public class WhCellRepository(MichelinDbContext context):IWhCellRepository
{
public WH_CELL? GetCell(int cellId)
{
var cell = context.Wh_Cell.First(x => x.CELL_ID == cellId);
return cell;
}
public WH_CELL? GetCell(string cellCode)
{
WH_CELL? cell = context.Wh_Cell.FirstOrDefault(x => x.CELL_CODE == cellCode);
return cell;
}
public bool UpdateCell(WH_CELL whCell)
{
if (whCell == null)
{
throw new ArgumentNullException(nameof(whCell));
}
context.Wh_Cell.Update(whCell);
context.SaveChanges();
return true;
}
/// <summary>
/// 更新状态
/// </summary>
/// <param name="cellId"></param>
/// <param name="cellStatus"></param>
/// <param name="runStatus"></param>
/// <param name="sResult"></param>
/// <returns></returns>
public bool UpdateCellStatusAndRunStatus(int cellId, string cellStatus, string runStatus,out string sResult)
{
bool bResult = true;
sResult = string.Empty;
if (cellId <= 0)
{
sResult = "CellId is invalid";
bResult = false;
return bResult;
}
}
}