using HH.WCS.Hexafluo;
using HH.WCS.Hexafluo.util;
using HH.WCS.Hexafluo.wms;
using HH.WCS.SJML.Dto;
using HH.WCS.SJML.Entitys;
using System;
namespace HH.WCS.SJML.wms
{
public class CntrItemRelHelper
{
///
/// 添加数据到重量计算表
///
///
public OperateResult InsertProviderAdd(TN_WeightCounterEntitys tN_Weight)
{
OperateResult result = OperateResult.Succeed();
try
{
SqlSugarHelper.Db.BeginTran();
var I = SqlSugarHelper.Db.Insertable(tN_Weight).ExecuteCommand();
if (I == 0)
{
throw new Exception("添加重量计算表 影响行数为0");
}
SqlSugarHelper.Db.Ado.CommitTran();
return result;
}
catch (Exception ex)
{
LogHelper.Info("原料入库", "添加重量计算表报错--" + ex.Message + ex.StackTrace);
SqlSugarHelper.Db.Ado.RollbackTran();
return OperateResult.Error(ex.Message);
}
}
///
/// 物料品质修改
///
///
///
public OperateResult SjUpdateItemState_CntrItemRelUpdate(UpdateItemStateDto Vendor)
{
try
{
OperateResult result = OperateResult.Succeed();
SqlSugarHelper.Db.BeginTran();
var I = SqlSugarHelper.Db.Updateable().SetColumns(it => it.S_ITEM_STATE == Vendor.ItemState).Where(x => x.S_BATCH_NO == Vendor.flot).ExecuteCommand();
if (I == 0)
{
throw new Exception("物料表更新失败");
}
SqlSugarHelper.Db.CommitTran();
return result;
}
catch (Exception ex)
{
SqlSugarHelper.Db.RollbackTran();
LogHelper.Info("物料品质修改", "更新报错--" + ex.Message + ex.StackTrace);
return OperateResult.Error(ex.Message);
}
}
}
}