码迷,mamicode.com
首页 > 其他好文 > 详细

Cloud保存时提示消息是否保存,点是保存,点否不保存。

时间:2020-02-18 20:42:42      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:plugin   bsp   fir   lin   before   不一致   linq   val   ada   

业务场景:保存时,检查上游的销售出库单数量,和发货通知单数量是否一致,不一致时提示信息,点是则保存,点否不保存。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kingdee.BOS.Core;
using Kingdee.BOS.Core.DynamicForm.PlugIn.WizardForm;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.Metadata.EntityElement;
using Kingdee.BOS.Orm.DataEntity;
using System.Data;
using System.Collections;
using Kingdee.BOS.Core.DynamicForm;

namespace KDDHandle
{
    public class BoxAll : AbstractBillPlugIn
    {
        //是否弹出提示框标识
        private bool isShowMessage = true;

        public override void BeforeSave(Kingdee.BOS.Core.Bill.PlugIn.Args.BeforeSaveEventArgs e)
        {
            base.BeforeSave(e);
            this.View.Model.SetValue("F_ora_Integer", AllBoxNum());

            DataSet ds = Kingdee.BOS.ServiceHelper.DBServiceHelper.ExecuteDataSet
                        (this.Context, "exec A_eifire_KDDSaveCheck " + this.View.Model.GetValue("F_ora_Text1").ToString());

            if (ds.Tables[0].Rows[0][0].ToString() == "1")
            {
                string msg = ds.Tables[1].Rows[0][0].ToString();
                if (msg.Trim() != "" && isShowMessage)
                {
                    e.Cancel = true;
                    this.View.ShowMessage(msg.Replace("#####", Environment.NewLine), MessageBoxOptions.YesNo, new Action<MessageBoxResult>(result =>
                        {
                            if (result == MessageBoxResult.Yes)
                            {
                                isShowMessage = false;
                                this.View.InvokeFormOperation(FormOperationEnum.Save);//调用平台内置保存操作
                            }
                            else
                            {
                                //取消保存逻辑
                            }
                        }));
                }
            }
        }
    }
}

Cloud保存时提示消息是否保存,点是保存,点否不保存。

标签:plugin   bsp   fir   lin   before   不一致   linq   val   ada   

原文地址:https://www.cnblogs.com/zfangfang/p/12327619.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!