43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using WX.CRM.IBLL.Ord;
|
|
using WX.CRM.Model.Entity;
|
|
|
|
namespace WX.CRM.BLL.Ord
|
|
{
|
|
public class ORD_HEGUIMEMO_BL : IORD_HEGUIMEMO, IORD_HEGUIMEMO_Q
|
|
{
|
|
public void CreateListMemo(List<WX.CRM.Model.Entity.ORD_HEGUIMEMO> LIST)
|
|
{
|
|
using (var db = new crmContext())
|
|
{
|
|
foreach (var model in LIST)
|
|
{
|
|
db.ORD_HEGUIMEMO.Add(model);
|
|
}
|
|
db.SaveChanges();
|
|
}
|
|
}
|
|
|
|
public decimal getLastMemoid(decimal memosubtypeid)
|
|
{
|
|
using (var db = new crmContext())
|
|
{
|
|
try
|
|
{
|
|
return db.ORD_HEGUIMEMO.Where(p => p.MEMOSUBTYPEID == memosubtypeid).Max(p => p.MEMOID);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
int count = db.ORD_HEGUIMEMO.Count(p => p.MEMOSUBTYPEID == memosubtypeid);
|
|
if (count == 0)
|
|
return 0;
|
|
else
|
|
throw ex;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|