예제 #1
0
파일: LayerB_mu.cs 프로젝트: krt/OpenTouryo
        /// <summary>業務処理を実装</summary>
        /// <param name="muParameter">汎用引数クラス</param>
        private void UOC_Insert(MuParameterValue muParameter)
        {
            // 戻り値クラスを生成して、事前に戻り地に設定しておく。
            MuReturnValue muReturn = new MuReturnValue();
            this.ReturnValue = muReturn;

            // 引数をアンマーシャル
            DTTables dtts_in = DTTables.StringToDTTables(muParameter.Value);
            DTTable dtt_in = dtts_in[0];
            DTRow dtrow_in = dtt_in.Rows[0];

            //DTTables dtts_out = null;
            //DTTable dtt_out = null;
            //DTRow dtrow_out = null;

            // ↓業務処理-----------------------------------------------------
            
            switch ((muParameter.ActionType.Split('%'))[1])
            {
                case "common": // 共通Daoを使用する。

                    // 共通Daoを生成
                    CmnDao cmnDao = new CmnDao(this.GetDam());

                    cmnDao.SQLFileName = "ShipperInsert.sql";

                    // パラメタ ライズド クエリのパラメタに対して、動的に値を設定する。
                    cmnDao.SetParameter("P2", dtrow_in["CompanyName"]);
                    cmnDao.SetParameter("P3", dtrow_in["Phone"]);

                    // 共通Daoを実行
                    // 戻り値を設定
                    muReturn.Value = cmnDao.ExecInsUpDel_NonQuery().ToString();

                    break;

                case "generate": // 自動生成Daoを使用する。

                    // 自動生成Daoを生成
                    DaoShippers genDao = new DaoShippers(this.GetDam());

                    // パラメタに対して、動的に値を設定する。
                    genDao.CompanyName = dtrow_in["CompanyName"];
                    genDao.Phone = dtrow_in["Phone"];

                    // 自動生成Daoを実行
                    // 戻り値を設定
                    muReturn.Value = genDao.D1_Insert().ToString();

                    break;

                default: // 個別Daoを使用する。

                    // 個別Daoを実行
                    // 戻り値を設定
                    LayerD_mu myDao = new LayerD_mu(this.GetDam());
                    myDao.Insert(muParameter.ActionType,
                        (string)dtrow_in["CompanyName"],
                        (string)dtrow_in["Phone"],
                        out muReturn.Value);

                    break;
            }

            // ↑業務処理-----------------------------------------------------

            // ロールバックのテスト
            this.TestRollback(muParameter);
        }
예제 #2
0
파일: LayerB_sb.cs 프로젝트: krt/OpenTouryo
        /// <summary>業務処理を実装</summary>
        /// <param name="muParameter">汎用引数クラス</param>
        private void UOC_Insert(MuParameterValue muParameter)
        {
            // 戻り値クラスを生成して、事前に戻り地に設定しておく。
            MuReturnValue muReturn = new MuReturnValue();
            this.ReturnValue = muReturn;
            
            // ↓業務処理-----------------------------------------------------
            string companyName = ((string[])(muParameter.Bean))[0];
            string phone = ((string[])(muParameter.Bean))[1];

            switch ((muParameter.ActionType.Split('%'))[1])
            {
                case "common": // 共通Daoを使用する。

                    // 共通Daoを生成
                    CmnDao cmnDao = new CmnDao(this.GetDam());

                    cmnDao.SQLFileName = "ShipperInsert.sql";

                    // パラメタ ライズド クエリのパラメタに対して、動的に値を設定する。
                    cmnDao.SetParameter("P2", companyName);
                    cmnDao.SetParameter("P3", phone);

                    // 共通Daoを実行
                    // 戻り値を設定
                    muReturn.Bean = cmnDao.ExecInsUpDel_NonQuery().ToString();

                    break;

                case "generate": // 自動生成Daoを使用する。

                    // 自動生成Daoを生成
                    DaoShippers genDao = new DaoShippers(this.GetDam());

                    // パラメタに対して、動的に値を設定する。
                    genDao.CompanyName = companyName;
                    genDao.Phone = phone;

                    // 自動生成Daoを実行
                    // 戻り値を設定
                    muReturn.Bean = genDao.D1_Insert().ToString();

                    break;

                default: // 個別Daoを使用する。
                    string ret = "";
                    LayerD_mu myDao = new LayerD_mu(this.GetDam());
                    myDao.Insert(muParameter.ActionType, companyName, phone, out ret);
                    muReturn.Bean = ret;

                    break;
            }

            // ↑業務処理-----------------------------------------------------

            // ロールバックのテスト
            this.TestRollback(muParameter);
        }
예제 #3
0
파일: LayerB_rt.cs 프로젝트: krt/OpenTouryo
        /// <summary>業務処理を実装</summary>
        /// <param name="muParameter">汎用引数クラス</param>
        private void UOC_Insert(MuParameterValue muParameter)
        {
            // 戻り値クラスを生成して、事前に戻り地に設定しておく。
            MuReturnValue muReturn = new MuReturnValue();
            muReturn.Bean = new Informations("");
            this.ReturnValue = muReturn;

            // 引数をアンマーシャル
            Dictionary<string, string> dic = ((Informations)muParameter.Bean).Dictionary;

            // ↓業務処理-----------------------------------------------------
            
            switch ((muParameter.ActionType.Split('%'))[1])
            {
                case "common": // 共通Daoを使用する。

                    // 共通Daoを生成
                    CmnDao cmnDao = new CmnDao(this.GetDam());

                    cmnDao.SQLFileName = "ShipperInsert.sql";

                    // パラメタ ライズド クエリのパラメタに対して、動的に値を設定する。
                    cmnDao.SetParameter("P2", dic["CompanyName"]);
                    cmnDao.SetParameter("P3", dic["Phone"]);

                    // 共通Daoを実行
                    // 戻り値を設定
                    muReturn.Bean = new Informations(cmnDao.ExecInsUpDel_NonQuery().ToString());

                    break;

                case "generate": // 自動生成Daoを使用する。

                    // 自動生成Daoを生成
                    DaoShippers genDao = new DaoShippers(this.GetDam());

                    // パラメタに対して、動的に値を設定する。
                    genDao.CompanyName = dic["CompanyName"];
                    genDao.Phone = dic["Phone"];

                    // 自動生成Daoを実行
                    // 戻り値を設定
                    muReturn.Bean = new Informations(genDao.D1_Insert().ToString());

                    break;

                default: // 個別Daoを使用する。

                    // 個別Daoを実行
                    string ret = "";
                    LayerD_mu myDao = new LayerD_mu(this.GetDam());
                    myDao.Insert(muParameter.ActionType,
                        dic["CompanyName"],
                        dic["Phone"],
                        out ret);

                    // 戻り値を設定
                    muReturn.Bean = new Informations(ret);

                    break;
            }

            // ↑業務処理-----------------------------------------------------

            // ロールバックのテスト
            this.TestRollback(muParameter);
        }