|
|
|
@ -229,10 +229,20 @@ namespace ButcherFactory.BO.LocalBL |
|
|
|
} |
|
|
|
|
|
|
|
public static void Delete(long id) |
|
|
|
{ |
|
|
|
var delete = new DQDeleteDom(typeof(CarcassSaleOut_Detail)); |
|
|
|
{ |
|
|
|
using (var session = DmoSession.New()) |
|
|
|
{ |
|
|
|
var item = session.Load(new DmoIdentity(typeof(CarcassSaleOut_Detail),id)) as CarcassSaleOut_Detail; |
|
|
|
SaveDeleteInfo(session, item); |
|
|
|
Delete(session, id); |
|
|
|
session.Commit(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static void Delete(IDmoSession session, long id) |
|
|
|
{ var delete = new DQDeleteDom(typeof(CarcassSaleOut_Detail)); |
|
|
|
delete.Where.Conditions.Add(DQCondition.EQ("ID", id)); |
|
|
|
delete.EExecute(); |
|
|
|
delete.EExecute(); |
|
|
|
} |
|
|
|
|
|
|
|
public static void AddAndUpdate(CarcassSaleOut_Detail detail, int flag,DateTime? productTime) |
|
|
|
@ -257,27 +267,27 @@ namespace ButcherFactory.BO.LocalBL |
|
|
|
public static void DeleteAndUpdate(CarcassSaleOut_Detail tag) |
|
|
|
{ |
|
|
|
var json = JsonConvert.SerializeObject(new List<ExtensionObj>() { new ExtensionObj { LongExt1 = tag.DetailID, LongExt2 = tag.WeightRecord_ID, LongExt3 = tag.ScanRecord_ID } }); |
|
|
|
RpcFacade.Call<int>(RpcPath + "SaleOutStoreRpc/DeleteAndUpdate", json); |
|
|
|
SaveDeleteInfo(tag); |
|
|
|
Delete(tag.ID); |
|
|
|
} |
|
|
|
|
|
|
|
static void SaveDeleteInfo(CarcassSaleOut_Detail tag) |
|
|
|
{ |
|
|
|
using (var session = DmoSession.New()) |
|
|
|
{ |
|
|
|
var delete = new CarcassSaleOut_Delete(); |
|
|
|
var type = typeof(CarcassSaleOut_Delete); |
|
|
|
foreach (var p in tag.GetType().GetProperties()) |
|
|
|
{ |
|
|
|
if (p.CanWrite) |
|
|
|
type.GetProperty(p.Name).SetValue(delete, p.GetValue(tag)); |
|
|
|
} |
|
|
|
delete.DeleteTime = DateTime.Now; |
|
|
|
delete.Deleter = AppContext.Worker.Name; |
|
|
|
session.Insert(delete); |
|
|
|
session.Commit(); |
|
|
|
RpcFacade.Call<int>(RpcPath + "SaleOutStoreRpc/DeleteAndUpdate", json); |
|
|
|
using (var session = DmoSession.New()) |
|
|
|
{ |
|
|
|
SaveDeleteInfo(session, tag); |
|
|
|
Delete(session, tag.ID); |
|
|
|
session.Commit(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static void SaveDeleteInfo(IDmoSession session, CarcassSaleOut_Detail tag) |
|
|
|
{ |
|
|
|
var delete = new CarcassSaleOut_Delete(); |
|
|
|
var type = typeof(CarcassSaleOut_Delete); |
|
|
|
foreach (var p in tag.GetType().GetProperties()) |
|
|
|
{ |
|
|
|
if (p.CanWrite) |
|
|
|
type.GetProperty(p.Name).SetValue(delete, p.GetValue(tag)); |
|
|
|
} |
|
|
|
delete.DeleteTime = DateTime.Now; |
|
|
|
delete.Deleter = AppContext.Worker.Name; |
|
|
|
session.Insert(delete); |
|
|
|
} |
|
|
|
|
|
|
|
public static void RollBackDetails(List<CarcassSaleOut_Detail> backList) |
|
|
|
|