dd
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class HJGL_Match_InStorageItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取信息
|
||||
/// </summary>
|
||||
/// <param name="InStorageId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.HJGL_Match_InStorageItem GetInHJGL_Match_InStorageItemByInStorageIdMaterialId(string InStorageId, string MaterialId)
|
||||
{
|
||||
return Funs.DB.HJGL_Match_InStorageItem.FirstOrDefault(e => e.InStorageId == InStorageId && e.MaterialId == MaterialId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="personCheck"></param>
|
||||
public static void AddInStorageItem(Model.HJGL_Match_InStorageItem inStorageItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_InStorageItem newInStorageItem = new Model.HJGL_Match_InStorageItem();
|
||||
newInStorageItem.InStorageItemId = inStorageItem.InStorageItemId;
|
||||
newInStorageItem.InStorageId = inStorageItem.InStorageId;
|
||||
newInStorageItem.MaterialId = inStorageItem.MaterialId;
|
||||
newInStorageItem.InCount = inStorageItem.InCount;
|
||||
|
||||
db.HJGL_Match_InStorageItem.InsertOnSubmit(newInStorageItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改进料单
|
||||
/// </summary>
|
||||
/// <param name="InStorageItem"></param>
|
||||
public static void UpdateInStorageItem(Model.HJGL_Match_InStorageItem InStorageItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_InStorageItem newInStorage = db.HJGL_Match_InStorageItem.FirstOrDefault(e => e.InStorageItemId == InStorageItem.InStorageItemId);
|
||||
if (newInStorage != null)
|
||||
{
|
||||
newInStorage.InCount = InStorageItem.InCount;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据进料单单一删除明细
|
||||
/// </summary>
|
||||
/// <param name="inStorageItemId"></param>
|
||||
public static void DelInStorageItemByinStorageItemId(string inStorageItemId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_InStorageItem item = db.HJGL_Match_InStorageItem.FirstOrDefault(e => e.InStorageItemId == inStorageItemId);
|
||||
if (item != null)
|
||||
{
|
||||
db.HJGL_Match_InStorageItem.DeleteOnSubmit(item);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据进料单删除多条明细记录
|
||||
/// </summary>
|
||||
/// <param name="PersonCheckId"></param>
|
||||
public static void DelInStorageItemByInStorageId(string InStorageId)
|
||||
{
|
||||
var itemList = (from x in Funs.DB.HJGL_Match_InStorageItem where x.InStorageId == InStorageId select x).ToList();
|
||||
if (itemList.Count() > 0)
|
||||
{
|
||||
var inStorage = BLL.HJGL_Match_InStorageService.GetHJGL_Match_InStorageByInStorageId(InStorageId);
|
||||
if (inStorage != null && inStorage.State == "1")
|
||||
{
|
||||
foreach (var item in itemList)
|
||||
{
|
||||
Model.HJGL_Match_Storage storage = BLL.HJGL_Match_StorageService.GetHJGL_Match_StorageByMaterialId(item.MaterialId);
|
||||
if (storage != null)
|
||||
{
|
||||
storage.InCount -= item.InCount;
|
||||
BLL.HJGL_Match_StorageService.UpdateHJGL_Match_Storage(storage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Funs.DB.HJGL_Match_InStorageItem.DeleteAllOnSubmit(itemList);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表集合
|
||||
/// </summary>
|
||||
/// <param name="PersonCheckId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.HJGL_Match_InStorageItem> getInStorageItemByInStorageId(string InStorageId)
|
||||
{
|
||||
return (from x in Funs.DB.HJGL_Match_InStorageItem where x.InStorageId == InStorageId orderby x.MaterialId select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class HJGL_Match_InStorageService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取信息
|
||||
/// </summary>
|
||||
/// <param name="InStorageId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.HJGL_Match_InStorage GetHJGL_Match_InStorageByInStorageId(string InStorageId)
|
||||
{
|
||||
return Funs.DB.HJGL_Match_InStorage.FirstOrDefault(e => e.InStorageId == InStorageId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加进料单
|
||||
/// </summary>
|
||||
/// <param name="inStorage"></param>
|
||||
public static void AddHJGL_Match_InStorage(Model.HJGL_Match_InStorage inStorage)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_InStorage newInStorage = new Model.HJGL_Match_InStorage();
|
||||
newInStorage.InStorageId = inStorage.InStorageId;
|
||||
newInStorage.InStorageCode = inStorage.InStorageCode;
|
||||
newInStorage.ProjectId = inStorage.ProjectId;
|
||||
newInStorage.UnitId = inStorage.UnitId;
|
||||
newInStorage.InTime = inStorage.InTime;
|
||||
newInStorage.CompileMan = inStorage.CompileMan;
|
||||
newInStorage.State = inStorage.State;
|
||||
db.HJGL_Match_InStorage.InsertOnSubmit(newInStorage);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改进料单
|
||||
/// </summary>
|
||||
/// <param name="inStorage"></param>
|
||||
public static void UpdateHJGL_Match_InStorage(Model.HJGL_Match_InStorage inStorage)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_InStorage newInStorage = db.HJGL_Match_InStorage.FirstOrDefault(e => e.InStorageId == inStorage.InStorageId);
|
||||
if (newInStorage != null)
|
||||
{
|
||||
newInStorage.InStorageCode = inStorage.InStorageCode;
|
||||
newInStorage.ProjectId = inStorage.ProjectId;
|
||||
newInStorage.UnitId = inStorage.UnitId;
|
||||
newInStorage.InTime = inStorage.InTime;
|
||||
newInStorage.CompileMan = inStorage.CompileMan;
|
||||
newInStorage.State = inStorage.State;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据进料单Id删除一个进料单信息
|
||||
/// </summary>
|
||||
/// <param name="InStorageId"></param>
|
||||
public static void DeleteHJGL_Match_InStorage(string InStorageId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_InStorage inHJGL_Match_InStorage = db.HJGL_Match_InStorage.FirstOrDefault(e => e.InStorageId == InStorageId);
|
||||
if (inHJGL_Match_InStorage != null)
|
||||
{
|
||||
db.HJGL_Match_InStorage.DeleteOnSubmit(inHJGL_Match_InStorage);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 材料信息
|
||||
/// </summary>
|
||||
public static class HJGL_Match_MaterialService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据材料信息Id获取材料信息
|
||||
/// </summary>
|
||||
/// <param name="ndtrId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.HJGL_Match_Material GetMaterialByMaterialId(string materialId)
|
||||
{
|
||||
return Funs.DB.HJGL_Match_Material.FirstOrDefault(e => e.MaterialId == materialId);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据材料信息Id获取材料信息
|
||||
/// </summary>
|
||||
/// <param name="ndtrId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.HJGL_Match_Material GetMaterialByMaterialCode(string code)
|
||||
{
|
||||
return Funs.DB.HJGL_Match_Material.FirstOrDefault(e => e.Code == code);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据材料信息Id获取材料信息
|
||||
/// </summary>
|
||||
/// <param name="ndtrId"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExistMaterialByMaterialIdCode(string materialId,string code)
|
||||
{
|
||||
var material = Funs.DB.HJGL_Match_Material.FirstOrDefault(e =>e.Code== code && e.MaterialId != materialId);
|
||||
return material != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据材料信息Id获取材料信息
|
||||
/// </summary>
|
||||
/// <param name="ndtrId"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExistMaterialByMaterialIdName(string materialId, string name)
|
||||
{
|
||||
var material = Funs.DB.HJGL_Match_Material.FirstOrDefault(e => e.Name == name && e.MaterialId != materialId);
|
||||
return material != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加材料信息
|
||||
/// </summary>
|
||||
/// <param name="ndtrate"></param>
|
||||
public static void AddMaterial(Model.HJGL_Match_Material material)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_Material newMaterial = new Model.HJGL_Match_Material();
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.HJGL_Match_Material));
|
||||
newMaterial.MaterialId = newKeyID;
|
||||
newMaterial.Code = material.Code;
|
||||
newMaterial.Name = material.Name;
|
||||
newMaterial.Standard = material.Standard;
|
||||
newMaterial.ProjectId = material.ProjectId;
|
||||
newMaterial.UNIT = material.UNIT;
|
||||
newMaterial.SteelName = material.SteelName;
|
||||
db.HJGL_Match_Material.InsertOnSubmit(newMaterial);
|
||||
db.SubmitChanges();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="ndtrate"></param>
|
||||
public static void UpdateMaterial(Model.HJGL_Match_Material material)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_Material newMaterial = db.HJGL_Match_Material.FirstOrDefault(e => e.MaterialId == material.MaterialId);
|
||||
if (newMaterial != null)
|
||||
{
|
||||
newMaterial.Code = material.Code;
|
||||
newMaterial.Name = material.Name;
|
||||
newMaterial.Standard = material.Standard;
|
||||
newMaterial.ProjectId = material.ProjectId;
|
||||
newMaterial.UNIT = material.UNIT;
|
||||
newMaterial.SteelName = material.SteelName;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="ndtrateId"></param>
|
||||
public static void DeleteMaterial(string materialId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_Material material = db.HJGL_Match_Material.FirstOrDefault(e => e.MaterialId == materialId);
|
||||
if (material != null)
|
||||
{
|
||||
db.HJGL_Match_Material.DeleteOnSubmit(material);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否存在相同的材料编号
|
||||
/// </summary>
|
||||
/// <param name="ndtrateCode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExitMaterialCode(string code, string projectId, string materialId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = from x in db.HJGL_Match_Material where x.Code == code && x.ProjectId == projectId && x.MaterialId != materialId select x;
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取材料信息下拉框
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.HJGL_Match_Material> GetMaterialNameList(string projectId)
|
||||
{
|
||||
var q = (from x in Funs.DB.HJGL_Match_Material where x.ProjectId == projectId orderby x.Code select x).ToList();
|
||||
return q;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 管线管线材料对应对应信息
|
||||
/// </summary>
|
||||
public static class HJGL_Match_PipeMaterialService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据管线材料对应信息Id获取管线材料对应信息
|
||||
/// </summary>
|
||||
/// <param name="ndtrId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.HJGL_Match_PipeMaterial GetHJGL_Match_PipeMaterialByPipeMaterialId(string pipeMaterialId)
|
||||
{
|
||||
return Funs.DB.HJGL_Match_PipeMaterial.FirstOrDefault(e => e.PipeMaterialId == pipeMaterialId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据管线材料对应信息Id获取管线材料对应信息
|
||||
/// </summary>
|
||||
/// <param name="ndtrId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.HJGL_Match_PipeMaterial GetHJGL_Match_PipeMaterialByMaterialIdpipelineId(string materialId, string pipelineId)
|
||||
{
|
||||
return Funs.DB.HJGL_Match_PipeMaterial.FirstOrDefault(e => e.MaterialId == materialId && e.ISO_ID == pipelineId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加管线材料对应信息
|
||||
/// </summary>
|
||||
/// <param name="ndtrate"></param>
|
||||
public static void AddHJGL_Match_PipeMaterial(Model.HJGL_Match_PipeMaterial pipeMaterial)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_PipeMaterial newPipeMaterial = new Model.HJGL_Match_PipeMaterial();
|
||||
newPipeMaterial.PipeMaterialId = SQLHelper.GetNewID(typeof(Model.HJGL_Match_PipeMaterial));
|
||||
newPipeMaterial.ProjectId = pipeMaterial.ProjectId;
|
||||
newPipeMaterial.MaterialId = pipeMaterial.MaterialId;
|
||||
newPipeMaterial.ISO_ID = pipeMaterial.ISO_ID;
|
||||
newPipeMaterial.NeedCount = pipeMaterial.NeedCount;
|
||||
newPipeMaterial.UsedCount = pipeMaterial.UsedCount;
|
||||
db.HJGL_Match_PipeMaterial.InsertOnSubmit(newPipeMaterial);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="ndtrate"></param>
|
||||
public static void UpdateHJGL_Match_PipeMaterial(Model.HJGL_Match_PipeMaterial pipeMaterial)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_PipeMaterial newPipeMaterial = db.HJGL_Match_PipeMaterial.FirstOrDefault(e => e.PipeMaterialId == pipeMaterial.PipeMaterialId);
|
||||
if (newPipeMaterial != null)
|
||||
{
|
||||
newPipeMaterial.MaterialId = pipeMaterial.MaterialId;
|
||||
newPipeMaterial.ISO_ID = pipeMaterial.ISO_ID;
|
||||
newPipeMaterial.NeedCount = pipeMaterial.NeedCount;
|
||||
newPipeMaterial.UsedCount = pipeMaterial.UsedCount;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="ndtrateId"></param>
|
||||
public static void DeleteHJGL_Match_PipeMaterial(string PipeMaterialId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_PipeMaterial pipeMaterial = db.HJGL_Match_PipeMaterial.FirstOrDefault(e => e.PipeMaterialId == PipeMaterialId);
|
||||
if (pipeMaterial != null)
|
||||
{
|
||||
db.HJGL_Match_PipeMaterial.DeleteOnSubmit(pipeMaterial);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否存在相同的管线材料对应信息
|
||||
/// </summary>
|
||||
/// <param name="ndtrateCode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExitHJGL_Match_PipeMaterialCode(string materialId, string pipelineId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = from x in db.HJGL_Match_PipeMaterial where x.MaterialId == materialId && x.ISO_ID == pipelineId select x;
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 集合
|
||||
/// </summary>
|
||||
private static List<Model.HJGL_View_MatchPipeMaterial> ViewMatchPipeMaterialList
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询结果集合
|
||||
/// </summary>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="endDate"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.HJGL_View_MatchPipeMaterial> GetViewMatchPipeMaterialList()
|
||||
{
|
||||
return ViewMatchPipeMaterialList;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据项目状态获取管线组件匹配试图
|
||||
/// </summary>
|
||||
/// <param name="ManagerTotalId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.HJGL_View_MatchPipeMaterial> GetViewMatchPipeMaterial(string projectId, string rbMatch)
|
||||
{
|
||||
List<Model.HJGL_View_MatchPipeMaterial> returnViewMatch = new List<Model.HJGL_View_MatchPipeMaterial>();
|
||||
////取库存数量
|
||||
var storage = (from x in Funs.DB.HJGL_Match_Storage where x.ProjectId == projectId && ((x.InCount.HasValue ? x.InCount : 0) - (x.OutCount.HasValue ? x.OutCount : 0)) > 0 select x).ToList();
|
||||
if (storage.Count() > 0)
|
||||
{ ///单位下每个区域的需要匹配的管线
|
||||
List<Model.HJGL_View_MatchPipeMaterial> viewMatch = (from x in Funs.DB.HJGL_View_MatchPipeMaterial
|
||||
orderby x.ISO_IsoNo
|
||||
where x.ProjectId == projectId && (x.NeedCount - x.UsedCount) > 0
|
||||
select x).ToList();
|
||||
|
||||
if (rbMatch == "1")
|
||||
{
|
||||
foreach (var viewItem in viewMatch)
|
||||
{
|
||||
var matchStorage = storage.FirstOrDefault(x => x.MaterialId == viewItem.MaterialId && ((x.InCount.HasValue ? x.InCount : 0) - (x.OutCount.HasValue ? x.OutCount : 0)) >= viewItem.NowNeedCount);
|
||||
if (matchStorage != null)
|
||||
{
|
||||
viewItem.MatchCount = viewItem.NowNeedCount.Value;
|
||||
returnViewMatch.Add(viewItem);
|
||||
|
||||
storage.Remove(matchStorage);
|
||||
matchStorage.OutCount = (matchStorage.OutCount.HasValue ? matchStorage.OutCount : 0) + viewItem.MatchCount;
|
||||
storage.Add(matchStorage); ///更新库存中的数量
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var viewItem in viewMatch)
|
||||
{
|
||||
var matchStorage = storage.FirstOrDefault(x => x.MaterialId == viewItem.MaterialId);
|
||||
if (matchStorage != null)
|
||||
{
|
||||
////库存数量
|
||||
decimal sCount = ((matchStorage.InCount.HasValue ? matchStorage.InCount : 0) - (matchStorage.OutCount.HasValue ? matchStorage.OutCount : 0)).Value;
|
||||
if (sCount >= viewItem.NowNeedCount) ////库存数量大于等于匹配量
|
||||
{
|
||||
viewItem.MatchCount = viewItem.NowNeedCount.Value;
|
||||
returnViewMatch.Add(viewItem);
|
||||
|
||||
storage.Remove(matchStorage);
|
||||
matchStorage.OutCount = (matchStorage.OutCount.HasValue ? matchStorage.OutCount : 0) + viewItem.MatchCount;
|
||||
storage.Add(matchStorage); ///更新库存中的数量
|
||||
}
|
||||
else ////库存数量小于匹配量
|
||||
{
|
||||
viewItem.MatchCount = sCount;
|
||||
returnViewMatch.Add(viewItem);
|
||||
////这个材料在库存量为0了
|
||||
storage.Remove(matchStorage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ViewMatchPipeMaterialList= returnViewMatch;
|
||||
return returnViewMatch;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class HJGL_Match_StorageService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取库存记录
|
||||
/// </summary>
|
||||
/// <param name="InStorageId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.HJGL_Match_Storage GetHJGL_Match_StorageByMaterialId(string MaterialId)
|
||||
{
|
||||
return Funs.DB.HJGL_Match_Storage.FirstOrDefault(e => e.MaterialId == MaterialId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加库存记录
|
||||
/// </summary>
|
||||
/// <param name="HJGL_Match_Storage"></param>
|
||||
public static void AddHJGL_Match_Storage(Model.HJGL_Match_Storage HJGL_Match_Storage)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_Storage newHJGL_Match_Storage = new Model.HJGL_Match_Storage();
|
||||
newHJGL_Match_Storage.StorageId = HJGL_Match_Storage.StorageId;
|
||||
newHJGL_Match_Storage.ProjectId = HJGL_Match_Storage.ProjectId;
|
||||
newHJGL_Match_Storage.MaterialId = HJGL_Match_Storage.MaterialId;
|
||||
newHJGL_Match_Storage.InCount = HJGL_Match_Storage.InCount;
|
||||
newHJGL_Match_Storage.OutCount = HJGL_Match_Storage.OutCount;
|
||||
|
||||
db.HJGL_Match_Storage.InsertOnSubmit(newHJGL_Match_Storage);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改库存记录
|
||||
/// </summary>
|
||||
/// <param name="HJGL_Match_Storage"></param>
|
||||
public static void UpdateHJGL_Match_Storage(Model.HJGL_Match_Storage HJGL_Match_Storage)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Match_Storage newHJGL_Match_Storage = db.HJGL_Match_Storage.FirstOrDefault(e => e.StorageId == HJGL_Match_Storage.StorageId);
|
||||
if (newHJGL_Match_Storage != null)
|
||||
{
|
||||
newHJGL_Match_Storage.InCount = HJGL_Match_Storage.InCount;
|
||||
newHJGL_Match_Storage.OutCount = HJGL_Match_Storage.OutCount;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user