Example #1
0
        void WfShowFlowByAdo01(string pAdo01)
        {
            ado_tb adoModel;

            try
            {
                adoModel = BoSecurity.OfGetAdoModel(pAdo01);
                if (adoModel == null || GlobalFn.varIsNull(adoModel.ado14))
                {
                    return;
                }
                WfShowFlow(adoModel.ado14);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        /// <summary>
        /// 檢查使用者是否有權限,並開啟視窗
        /// </summary>
        /// <param name="pAdo01"></param>
        private void WfOpenForm(string pAdo01)
        {
            StringBuilder       sbSql;
            List <SqlParameter> sqlParmList;
            ado_tb adoModel;

            try
            {
                sbSql = new StringBuilder();
                sbSql.AppendLine("SELECT * FROM ado_tb");
                sbSql.AppendLine("WHERE ado01=@ado01");
                sqlParmList = new List <SqlParameter>();
                sqlParmList.Add(new SqlParameter("@ado01", pAdo01));
                adoModel = BoSecurity.OfGetAdoModel(pAdo01);

                if (adoModel == null)
                {
                    WfShowErrorMsg("無此作業代號!");
                    return;
                }
                if (GlobalFn.isNullRet(adoModel.ado07, "") == "M")
                {
                    //WfShowMsg("無此作業代號!");
                    return;
                }
                if (GlobalFn.isNullRet(adoModel.ado16, "").ToUpper() == "Y") //子程式不可由此進入
                {
                    WfShowErrorMsg("無此作業代號!");
                    return;
                }
                if (BoSecurity.OfChkAddPKExists(LoginInfo.UserRole, pAdo01) == false)
                {
                    WfShowErrorMsg("無此權限!");
                    return;
                }

                WfShowForm(adoModel);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        void ut_AfterActivate(object sender, NodeEventArgs e)
        {
            string        keyNode;
            UltraTreeNode utnActive;
            ado_tb        adoModel;

            try
            {
                utnActive = (sender as UltraTree).ActiveNode;
                keyNode   = utnActive.Key;
                //取得程式資料
                adoModel = BoSecurity.OfGetAdoModel(keyNode);
                if (adoModel == null || GlobalFn.isNullRet(adoModel.ado14, "") == "")
                {
                    return;
                }
                WfShowFlow(adoModel.ado14);
            }
            catch (Exception ex)
            {
                WfShowErrorMsg(ex.Message);
            }
        }
Example #4
0
        /**********************  新增/查詢/拷貝/存檔/刪除 相關 Function **********************/
        #region WfIniMaster() 設定表單主要的資料來源
        protected virtual Boolean WfIniMaster()
        {
            try
            {
                // 以 FormID 由 Pu_pgm 中取得表單設定
                #region 初始化 PU_BUSOBJ
                if (GlobalVar.PU_BUSOBJ != null)
                {
                    this.BoSecurity = (YR.ERP.BLL.MSSQL.AdmBLL)GlobalVar.PU_BUSOBJ;
                }
                else
                {
                    if (GlobalVar.Adm_DAO != null)
                    {
                        this.BoSecurity = new AdmBLL((YR.ERP.DAL.ERP_MSSQLDAL)GlobalVar.Adm_DAO);
                    }
                    else
                    {
                        //this.BoSecurity = new AdmBLL();
                    }
                }
                #endregion

                if (BoSecurity == null)
                {
                    return(false);
                }
                this.AdoModel = BoSecurity.OfGetAdoModel(StrFormID);
                if (AdoModel == null)
                {
                    return(false);
                }
                this.TabMaster.TargetTable  = AdoModel.ado05;
                this.TabMaster.TargetColumn = "*";
                this.TabMaster.ViewTable    = AdoModel.ado06;
                if (TabMaster.ViewTable == "")
                {
                    TabMaster.ViewTable = TabMaster.TargetTable;
                }

                if (BoSecurity == null)
                {
                    throw new Exception("物件BoSecurity,尚未初始化!");
                    //return false;
                }
                this.TabMaster.AzaTbList  = BoSecurity.OfGetAzaModels(TabMaster.ViewTable);
                this.TabMaster.AddTbModel = BoSecurity.OfGetAddModel(LoginInfo.UserRole, StrFormID);

                // 建立 Form Master 的 Business Object : boBasic
                this.WfCreateBoBasic();
                //取得baa_tb共用參數代碼
                if (BaaModel == null)
                {
                    using (var boBas = new BasBLL(BoMaster.OfGetConntion()))
                    {
                        if (BoMaster.TRAN != null)
                        {
                            boBas.TRAN = BoMaster.TRAN;
                        }
                        BaaModel = boBas.OfGetBaaModel();
                    }
                }

                #region 取得日期格式
                var baa01KvpList = new BasBLL().OfGetBaa01KVPList();//取得日期格式
                this.DateFormat = baa01KvpList.Where(x => x.Key == BaaModel.baa01)
                                  .Select(x => x.Value)
                                  .FirstOrDefault()
                ;

                if (GlobalFn.varIsNull(DateFormat))
                {
                    DateFormat = "yyyy/MM/dd";
                }
                else //取得格式會含有 . ex:1.yyyy/MM/dd 要剔除
                {
                    if (DateFormat.IndexOf('.') >= 0)
                    {
                        var dotPosition = DateFormat.IndexOf('.');
                        DateFormat = DateFormat.Substring(dotPosition + 1, DateFormat.Length - dotPosition - 1);
                    }
                }
                #endregion

                // 先取得空的資料表
                if (this.TabMaster.ViewTable != "")
                {
                    this.TabMaster.DtSource = this.TabMaster.BoBasic.OfSelect(" WHERE 1=2 ");
                    TabMaster.DtSource.Rows.Add(TabMaster.DtSource.NewRow());

                    this.WfSetMasterDatasource(this.TabMaster.DtSource);
                    this.BindingMaster.MoveFirst();
                    DrMaster = TabMaster.DtSource.Rows[0];
                    WfSetMasterRowDefault(DrMaster);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(true);
        }