Exemple #1
0
        protected override void WfActionClick(string pActionName)
        {
            vw_admq910 masterModel;
            string     killSql;

            try
            {
                switch (pActionName.ToLower())
                {
                case "killsession":
                    if (DrMaster == null)
                    {
                        return;
                    }
                    masterModel = DrMaster.ToItem <vw_admq910>();
                    if (masterModel.blkBy <= 0)
                    {
                        WfShowBottomStatusMsg("連線未被Lock不可刪除");
                        return;
                    }

                    if (WfShowConfirmMsg("請確認是否要刪除連線?") == DialogResult.Yes)
                    {
                        killSql = string.Concat("kill ", masterModel.blkBy, ";");
                        BoMaster.OfExecuteNonquery(killSql);
                        WfShowBottomStatusMsg("連線刪除成功!");
                        if (WfQueryOk())
                        {
                            WfDisplayMode();
                            WfAfterfDisplayMode();
                        }
                    }
                    break;

                case "refresh":
                    if (FormEditMode != YREditType.NA)
                    {
                        return;
                    }

                    //新增一列,模擬查詢
                    TabMaster.DtSource.Rows.Add(TabMaster.DtSource.NewRow());
                    WfGetActiveDatarow();
                    if (WfQueryOk())
                    {
                        WfDisplayMode();
                        WfAfterfDisplayMode();
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }