Browse Source

加批量调整。

master
yibo 7 years ago
parent
commit
eef7b06605
2 changed files with 41 additions and 1 deletions
  1. +28
    -0
      B3ClientService.Web/Pages/B3ClientService/BaseInfos/ClientGoodsSet_/ClientGoodsSetEdit.cs
  2. +13
    -1
      B3ClientService/OfflinRpc/SegmentProductionRpc.cs

+ 28
- 0
B3ClientService.Web/Pages/B3ClientService/BaseInfos/ClientGoodsSet_/ClientGoodsSetEdit.cs View File

@ -88,14 +88,42 @@ namespace BWP.Web.Pages.B3ClientService.BaseInfos.ClientGoodsSet_
}
_detailGrid.DataBind();
};
hPanel.Add(new SimpleLabel("标准上限"));
var up = hPanel.Add(new DFTextBox() { Width=Unit.Pixel(50)});
hPanel.Add(new SimpleLabel("标准上限"));
var dw = hPanel.Add(new DFTextBox() { Width = Unit.Pixel(50) });
hPanel.Add(new TSButton("更新上下限", delegate {
GetFromUI();
decimal? uValue = null;
decimal? wValue = null;
if (!up.IsEmpty)
uValue = decimal.Parse(up.Text);
if (!dw.IsEmpty)
wValue = decimal.Parse(dw.Text);
foreach (var d in _detailGrid.GetSelectedItems())
{
var detail = d as ClientGoodsSet_Detail;
if (detail.StandardWeight.HasValue)
{
if (uValue.HasValue)
detail.StandardWeightUp = detail.StandardWeight + uValue;
if (wValue.HasValue )
detail.StandardWeightLow = detail.StandardWeight - wValue;
}
}
AppToUI();
}));
};
var editor = new DFCollectionEditor<ClientGoodsSet_Detail>(() => Dmo.Details);
editor.AllowDeletionFunc = () => CanSave;
editor.CanDeleteFunc = detail => CanSave;
editor.IsEditableFunc = (field, detail) => CanSave;
editor.CanSelectFunc = (detail) => CanSave;
_detailGrid = new DFEditGrid(editor);
_detailGrid.DFGridSetEnabled = false;
_detailGrid.MultiSelectionEnabled = CanSave;
_detailGrid.Width = Unit.Percentage(100);
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_Code"));
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Goods_Name"));


+ 13
- 1
B3ClientService/OfflinRpc/SegmentProductionRpc.cs View File

@ -26,6 +26,11 @@ namespace BWP.B3ClientService.Rpcs
{
foreach (var item in list)
{
if(item.Delete)
{
Delete(session, item.BarCode);
continue;
}
var id = Exist(session, item.BarCode);
if (id == null)
{
@ -43,6 +48,13 @@ namespace BWP.B3ClientService.Rpcs
return list.Count;
}
static void Delete(IDmoSession session, string barCode)
{
var delete = new DQDeleteDom(typeof(SegmentProductionInfo));
delete.Where.Conditions.Add(DQCondition.EQ("BarCode", barCode));
session.ExecuteNonQuery(delete);
}
private static void Update(IDmoSession session, long id, SegmentProductionMin entity, params string[] fields)
{
var update = new DQUpdateDom(typeof(SegmentProductionInfo));
@ -106,6 +118,6 @@ namespace BWP.B3ClientService.Rpcs
public long? Goods_ID { get; set; }
public decimal? Weight { get; set; }
public DateTime? InStoreTime { get; set; }
public bool Delete { get; set; }
}
}

Loading…
Cancel
Save