首页 > 其他 > 详细

dfGetData

时间:2021-07-12 15:44:16      阅读:21      评论:0      收藏:0      [点我收藏+]

1.  $.map

 1 function btnUpdate1_click() {
 2     var grid = BUI.getControl(grid1);
 3     var selections = grid.getSelection();
 4     if (selections.length == 0) {
 5         dfAlert(getRes(请先选择记录));
 6         return;
 7     }
 8     var p = $.map(selections, function(a) {
 9         return {
10             PK_GUID: a.PK_GUID,
11             ISVALID: $(#ISVALID1).val()
12         }
13     });
14     if (confirm(getRes(确定要更新选定的记录么?))) {
15         dfGetData(DynamicForm.DA.Form_MES_T_LINEMATERIALDA.UpdateISVALID, {
16             DF_FORMNAME: Form_MES_T_MO,
17             data: BUI.JSON.stringify(p)
18         }, function(data) {
19             BUI.getControl(grid1).get(store).load();
20         });
21     }
22 }

2. 

 1 public DataGridVM UpdateISVALID(DFDictionary entity)
 2         {
 3             var data = JsonSerializeHelper.DeserializeObject<List<Dictionary<string, string>>>(entity["data"]);
 4             if (data == null)
 5             {
 6                 throw new WFException("无效的参数data".GetRes());
 7             }
 8             var user = Util.GetCurrentUser().UserName;
 9             using (var db = Pub.DB)
10             {
11                 db.Execute("update MES_T_WPMATERIAL set ISVALID=@ISVALID,LastModifyTime=@LastModifyTime,LastModifyUser=@LastModifyUser where PK_GUID=@PK_GUID", data.Select(a => new
12                 {
13                     ISVALID = a["ISVALID"],
14                     PK_GUID = a["PK_GUID"],
15                     LastModifyUser = user,
16                     LastModifyTime = DateTime.Now
17                 }).ToList());
18             }
19 
20             return new DataGridVM();
21         }

 

dfGetData

原文:https://www.cnblogs.com/cherry1022/p/15001191.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!