金蝶星空企业版 插件 通过SQL反写数据

金蝶星空企业版 插件 通过SQL反写数据

    [Kingdee.BOS.Util.HotUpdate]
    [Description("xx模块-下推stepx--xx插件反写xx资料")]
    public class XxxxYyyy : AbstractOperationServicePlugIn
    {
        private string ydbh = "F_QGXM_YDBH";//源单编号
        private string ydid = "F_QGXM_YDID";//源单id
        private string tbname = "t_8dreport";//源单表名

        private string[] field = { "F_QGXM_DQJD" };
        private string[] orm = { "F_QGXM_DQJD" };

        public override void EndOperationTransaction(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.EndOperationTransactionArgs e)
        {
            base.EndOperationTransaction(e);

            //通过SQL反写 Convert.ToString(this.View.Model.GetValue(ydbh))
            string billno = Convert.ToString(e.DataEntitys[0][ydbh]);
            string sql = $@"/*dialect*/
                update {tbname} 
                set {orm[0]}='xxxxxx'
                where FBILLNO='{billno}'";
            DBServiceHelper.Execute(this.Context, sql);
        }
    }

 

posted @ 2024-09-18 22:33  中国结  阅读(17)  评论(0编辑  收藏  举报