表单插件批量修改子单据体数据库数据原创
5人赞赏了该文章
641次浏览
编辑于2023年10月13日 11:46:05
public class buchonggongxu : AbstractDynamicFormPlugIn { public override void AfterBarItemClick(AfterBarItemClickEventArgs e) { if (e.BarItemKey == "Test") { EntryEntity FEntity = this.View.BusinessInfo.GetEntryEntity("FSubEntity"); DynamicObjectCollection d = this.View.Model.GetEntityDataObject(FEntity); var sql = "UPDATE T_SFC_OPERPLANNINGDETAIL SET F_BEC_SGX=@FbecSgx , F_BEC_XGX=@FbecXgx WHERE FDETAILID=@Id"; var SqlObjectList=new List<SqlObject>(); for (int i = 0; i < d.Count; i++) { var sqlParameterList = new List<SqlParam>(); sqlParameterList.Add(new SqlParam("@Id", KDDbType.Int32, d[i]["Id"])); sqlParameterList.Add(new SqlParam("@FbecSgx", KDDbType.Int32, d[i - 1]["ProcessId_Id"])); sqlParameterList.Add(new SqlParam("@FbecXgx", KDDbType.Int32, d[i + 1]["ProcessId_Id"])); var sqlObj = new SqlObject(sql, sqlParameterList); SqlObjectList.Add(sqlObj); } var returnValue = DBUtils.ExecuteBatch(this.Context, SqlObjectList); } this.View.UpdateView(); } }
赞 5
5人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!
推荐阅读