Browse Source

定级 修改 同步操作,增加删除操作

master
luanhui 8 years ago
parent
commit
f0c2bbc73a
3 changed files with 45 additions and 6 deletions
  1. +5
    -0
      BO/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs
  2. +7
    -3
      BO/Utils/BillRpc/GradeAndWeightRpc.cs
  3. +33
    -3
      WeighAndGrading/GradeFrom.cs

+ 5
- 0
BO/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs View File

@ -48,5 +48,10 @@ namespace BO.BO.Bill
public long ID { get; set; }
public bool Sync { get; set; }
/// <summary>
/// 是否删除的
/// </summary>
public bool IsDeleted { get; set; }
}
}

+ 7
- 3
BO/Utils/BillRpc/GradeAndWeightRpc.cs View File

@ -187,10 +187,14 @@ namespace BO.Utils.BillRpc
update.Where.Conditions.Add(DQCondition.EQ("SID", detail.SID));
foreach (var p in properties)
{
if (p == "Sync" && detail.Sync)
detail.Sync = false;
// if (p == "Sync" && detail.Sync)
// detail.Sync = false;
update.Columns.Add(new DQUpdateColumn(p, type.GetProperty(p).GetValue(detail)));
}
//只要修改就设置 Sync为False
update.Columns.Add(new DQUpdateColumn("Sync", false));
session.ExecuteNonQuery(update);
session.Commit();
}
@ -201,7 +205,7 @@ namespace BO.Utils.BillRpc
var syncs = GetAllNeedSyncDetails();
foreach (var detail in syncs)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/UpdateOrInsertDetail";
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc/UpdateOrInsertDetailOrDelete";
var id = RpcFacade.Call<long>(method, serializer.Serialize(detail));
SetDetailSynced(detail, id);


+ 33
- 3
WeighAndGrading/GradeFrom.cs View File

@ -1066,7 +1066,7 @@ namespace WeighAndGrading
}
//删除选中
private void btnDeleteSelected_Click(object sender, EventArgs e)
{
if (MessageBox.Show("确定删除选中一条称重记录?", "删除选中", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
@ -1083,8 +1083,38 @@ namespace WeighAndGrading
{
return;
}
//删除选中
LocalGradeAndWeightBL.DeleteBySID(lastCheckItem.SID);
//删除选中 更新 IsDeleted 和 Sync
lastCheckItem.IsDeleted = true;
LocalGradeAndWeightBL.Update(lastCheckItem, "IsDeleted");
//修改本地
if (lastCheckItem.OrderDetail_ID.HasValue)
{
VerifyConnection();
if (!connection)
{
//"烫褪" : "毛剥"
if (lastCheckItem.Technics_Name == "烫褪")
{
localTang = XmlUtil.DeserializeFromFile<List<long>>(tangFilePath);
if (localTang.Contains(lastCheckItem.OrderDetail_ID.Value))
{
localTang.Remove(lastCheckItem.OrderDetail_ID.Value);
SaveEntityToLocal(true);
}
}
else if (lastCheckItem.Technics_Name == "毛剥")
{
localMao = XmlUtil.DeserializeFromFile<List<long>>(maoFilePath);
if (localMao.Contains(lastCheckItem.OrderDetail_ID.Value))
{
localMao.Remove(lastCheckItem.OrderDetail_ID.Value);
SaveEntityToLocal(false);
}
}
}
}
details.Remove(lastCheckItem);


Loading…
Cancel
Save