Example #1
0
        ///<summary>
        ///setSelectItem
        ///データグリッドビューの処理
        ///作成者:大河内
        ///作成日:2017/3/28
        ///更新者:大河内
        ///更新日:2017/4/10
        ///カラム論理名
        ///</summary>
        public DataTable setSelectItem(List <string> lstString)
        {
            DataTable dtSelect = null;

            string strSQLName = null;

            //SQLのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            //データ渡し用
            List <string> lstStringSQL = new List <string>();

            strSQLName = "Tanaorosi_SELECT_SetItem";

            //データ渡し用
            lstStringSQL.Add(strSQLName);

            OpenSQL opensql     = new OpenSQL();
            string  strSQLInput = opensql.setOpenSQL(lstStringSQL);

            //配列設定
            string[] strArray = { lstString[0], lstString[1] };

            strSQLInput = string.Format(strSQLInput, strArray);

            dtSelect = dbconnective.ReadSql(strSQLInput);

            return(dtSelect);
        }
Example #2
0
        public DataTable baseText1_Leave(string strBaseText1)
        {
            string strSQLName = null;

            //データ渡し用
            List <string> lstStringSQL = new List <string>();

            strSQLName = "JuchuInput_SELECT_LEAVE";

            //データ渡し用
            lstStringSQL.Add(strSQLName);

            OpenSQL opensql     = new OpenSQL();
            string  strSQLInput = opensql.setOpenSQL(lstStringSQL);

            //配列設定
            string[] strArray = { strBaseText1 };

            strSQLInput = string.Format(strSQLInput, strArray);

            //SQLのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            DataTable dtSetcode_B = new DataTable();

            //SQL文を直書き(+戻り値を受け取る)
            dtSetcode_B = dbconnective.ReadSql(strSQLInput);

            return(dtSetcode_B);
        }
        public DataTable getTokuisakiInfo(string tCode)
        {
            DataTable dtTokuisakiInfo = new DataTable();

            // SQLのパス指定用List
            List <string> listSqlPath = new List <string>();

            listSqlPath.Add("E0330_TokuisakiMotocyoKakunin");
            listSqlPath.Add("E0330_TokuisakiMotocyoKakunin_TokuisakiSELECT");

            DBConnective dbconnective = new DBConnective();

            try
            {
                OpenSQL opensql = new OpenSQL();
                // sqlファイルからSQL文を取得
                string strSqltxt = opensql.setOpenSQL(listSqlPath);
                string sql       = string.Format(strSqltxt, tCode);

                dtTokuisakiInfo = dbconnective.ReadSql(sql);
            }
            catch (Exception ex)
            {
                new CommonException(ex);
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
            return(dtTokuisakiInfo);
        }
Example #4
0
        ///<summary>
        ///getTantoshaCd
        ///担当者コードの取り出し
        ///</summary>
        public string getTantoshaCd(string strUserID)
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパス用(フォーマット後)
            string strSQLInput = "";

            string strTantoshaCd = null;

            //SQLファイルのパスとファイル名を追加
            lstSQL.Add("Z0000");
            lstSQL.Add("MainMenu_TantoshaCd_SELECT");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL接続
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(strTantoshaCd);
                }

//テスト
                //strUserID = "a.kato";

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput, strUserID);

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLInput);

                if (dtSetCd_B.Rows.Count > 0)
                {
                    strTantoshaCd = dtSetCd_B.Rows[0]["担当者コード"].ToString();
                }

                return(strTantoshaCd);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
        /// <summary>
        ///     getMaxZaikoDate
        ///     在庫年月日の最大値を取得
        /// </summary>
        public DataTable getMaxZaikoDate()
        {
            DataTable dtKijunYmd = new DataTable();

            // SQLのパス指定用List
            List <string> listSqlPath = new List <string>();

            listSqlPath.Add("M1240_ShohinSiireKakakuSuii2");
            listSqlPath.Add("M1240_ShohinSiireKakakuSuii2_SELECT_kijun");

            DBConnective dbconnective = new DBConnective();

            try
            {
                OpenSQL opensql = new OpenSQL();
                // sqlファイルからSQL文を取得
                string strSqltxt = opensql.setOpenSQL(listSqlPath);

                // SELECT結果をDataTableへ
                dtKijunYmd = dbconnective.ReadSql(strSqltxt);

                return(dtKijunYmd);
            }
            catch
            {
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
        }
        ///<summary>
        ///judtxtDaibunruiLeave
        ///code入力箇所からフォーカスが外れた時
        ///作成者:大河内
        ///作成日:2017/3/21
        ///更新者:大河内
        ///更新日:2017/4/7
        ///カラム論理名
        ///</summary>
        public DataTable judTxtDaibunruiLeave(List <string> lstString)
        {
            //データ渡し用
            List <string> lstStringSQL = new List <string>();

            string strSQLName = null;

            strSQLName = "M1010_Daibun_SELECT_LEAVE";

            //データ渡し用
            lstStringSQL.Add("M1010_Daibunrui");
            lstStringSQL.Add(strSQLName);

            OpenSQL opensql     = new OpenSQL();
            string  strSQLInput = opensql.setOpenSQL(lstStringSQL);

            //配列設定
            string[] strArray = { lstString[0] };

            strSQLInput = string.Format(strSQLInput, strArray);

            DataTable dtSetcode_B = new DataTable();

            //SQLのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            //SQL文を直書き(+戻り値を受け取る)
            dtSetcode_B = dbconnective.ReadSql(strSQLInput);

            return(dtSetcode_B);
        }
Example #7
0
        ///<summary>
        ///setYMD
        ///最終棚卸年月日の表示
        ///作成者:大河内
        ///作成日:2017/3/22
        ///更新者:大河内
        ///更新日:2017/4/10
        ///カラム論理名
        ///</summary>
        public DataTable setYMD()
        {
            //データ渡し用
            List <string> lstStringSQL = new List <string>();

            DataTable dtYMD = new DataTable();

            //SQLのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            string strSQLName = null;

            strSQLName = "Tanaorosi_SELECT_SetYMD";

            //データ渡し用
            lstStringSQL.Add(strSQLName);

            OpenSQL opensql     = new OpenSQL();
            string  strSQLInput = opensql.setOpenSQL(lstStringSQL);

            strSQLInput = string.Format(strSQLInput);

            dtYMD = dbconnective.ReadSql(strSQLInput);

            dtYMD.Columns["Column1"].ColumnName = "最新棚卸年月日";

            return(dtYMD);
        }
        ///<summary>
        ///getDataCount
        ///データのカウント取得とMOデータのチェック
        ///</summary>
        public DataTable getDataCount(List <string> lstString)
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパス用(フォーマット後)
            string strSQLInput = "";

            //中分類コード用SQL
            string strSQLChubun = "";

            //SQLファイルのパスとファイル名を追加
            lstSQL.Add("B0250_MOnyuryoku");
            lstSQL.Add("MOnyuryoku_SELECT_GetDataCnt");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //中分類コードがある場合
            if (lstString[3].ToString().Trim() != "")
            {
                strSQLChubun = "AND 中分類コード= '" + lstString[3] + "'";
            }

            //SQL接続
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(dtSetCd_B);
                }

                //SQLファイルと該当コードでフォーマット(引数:[年月度],[メーカーコード],[大分類コード],[中分類コード])
                strSQLInput = string.Format(strSQLInput, lstString[0], lstString[1], lstString[2], strSQLChubun);

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLInput);

                return(dtSetCd_B);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
        /// <summary>
        ///     getCyokkinKingaku
        ///     直近金額を取得
        /// </summary>
        /// <param name = "lstItem">
        ///     検索条件格納しているLIST
        ///     lstItem[0] 基準在庫日,
        ///     lstItem[1] 大分類コード,
        ///     lstItem[2] 中分類コード,
        ///     lstItem[3] メーカーコード
        /// </param>
        public DataTable getCyokkinKingaku(List <string> lstItem)
        {
            string    andSql    = "";
            DataTable dtChokkin = new DataTable();
            // 基準在庫日取得
            string kijunYmd = lstItem[0];

            // SQLのパス指定用List
            List <string> listSqlPath = new List <string>();

            listSqlPath.Add("M1240_ShohinSiireKakakuSuii2");
            listSqlPath.Add("M1240_ShohinSiireKakakuSuii2_SELECT_chokkin");

            //strSql = "SELECT ";
            //strSql += " SUM(在庫数量*直近仕入単価) AS 直近仕入金額 ";
            //strSql += " FROM 商品仕入単価履歴TMP2 ";
            //strSql += " WHERE 在庫年月日='" + lstItem[0] + "'";

            // 大分類コードが空でない場合
            if (!lstItem[1].Equals(""))
            {
                andSql += " AND b.大分類コード='" + lstItem[1] + "'";
            }

            // 中分類コードが空でない場合
            if (!lstItem[2].Equals(""))
            {
                andSql += " AND b.中分類コード='" + lstItem[2] + "'";
            }

            // メーカーコードが空でない場合
            if (!lstItem[3].Equals(""))
            {
                andSql += " AND b.メーカーコード='" + lstItem[3] + "'";
            }

            DBConnective dbconnective = new DBConnective();

            try
            {
                OpenSQL opensql = new OpenSQL();
                // sqlファイルからSQL文を取得
                string strSqltxt = opensql.setOpenSQL(listSqlPath);
                string sql       = string.Format(strSqltxt, kijunYmd, andSql);

                // SELECT結果をDataTableへ
                dtChokkin = dbconnective.ReadSql(sql);

                return(dtChokkin);
            }
            catch
            {
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
        }
Example #10
0
        ///<summary>
        ///getMenuSet
        ///データを登録
        ///</summary>
        public void addMyMenu(List <string> lstMakerData)
        {
            //データ渡し用
            List <string> lstSQL = new List <string>();

            //データ渡し用
            lstSQL.Add("Z1500_MyMenuSet");
            lstSQL.Add("MyMenuSet_MenuSet_UPDATE");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            //トランザクション開始
            dbconnective.BeginTrans();
            try
            {
                //SQLファイルのパス取得
                string strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return;
                }

                string[] aryStr = new string[]
                {
                    lstMakerData[0],
                    lstMakerData[1],
                    lstMakerData[2]
                };

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput, aryStr);

                //SQL接続後、該当データを取得
                dbconnective.RunSql(strSQLInput);

                //コミット開始
                dbconnective.Commit();

                return;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
Example #11
0
        ///<summary>
        ///getViewGrid
        ///読み込み時の処理
        ///</summary>
        public DataTable getViewGrid()
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL      = new List <string>();
            string        strAddWhile = "";

            //データ渡し用
            lstSQL.Add("Common");
            lstSQL.Add("CommonForm");
            lstSQL.Add("TantoushaList_View");

            //データグリッドビューを入れる用
            DataTable dtGetTableGrid = new DataTable();

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //SQL用に移動
            DBConnective dbConnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                string strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(dtGetTableGrid);
                }

                // 表示コントロール
                if (blShowFlag == false)
                {
                    strAddWhile = " AND 担当者.表示 = '1' ";
                }
                else
                {
                    strAddWhile = "";
                }

                string sql = string.Format(strSQLInput, strAddWhile);

                //検索データを表示
                dtGetTableGrid = dbConnective.ReadSql(sql);

                return(dtGetTableGrid);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbConnective.DB_Disconnect();
            }
        }
Example #12
0
        ///<summary>
        ///addKengen
        ///新規でメニュー権限を追加
        ///</summary>
        public void addKengen(List <string> lstString)
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQLSelect = new List <string>();

            //SQLファイルのパスとファイル名を追加(メニュー権限取得)
            lstSQLSelect.Add("M1050_Tantousha");
            lstSQLSelect.Add("Tantousha_MenuKengen_SELECT");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得(メニュー権限取得)
                string strSQLSelect = opensql.setOpenSQL(lstSQLSelect);

                //パスがなければ返す
                if (strSQLSelect == "")
                {
                    return;
                }

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLSelect);

                //取得したメニュー権限分ループ
                for (int intCnt = 0; intCnt < dtSetCd_B.Rows.Count; intCnt++)
                {
                    string[] aryStrInsert = new string[] {
                        lstString[0],
                        dtSetCd_B.Rows[intCnt]["PG番号"].ToString(),
                        dtSetCd_B.Rows[intCnt]["PG名"].ToString(),
                        dtSetCd_B.Rows[intCnt]["権限"].ToString()
                    };

                    //SQL接続後、該当データを登録
                    dbconnective.RunSqlCommon("C_SQL_MENUKENGEN_UPD", aryStrInsert);
                }

                return;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
Example #13
0
        ///<summary>
        ///getShukoGrid
        ///出庫データの取得
        ///</summary>
        public DataTable getShukoGrid(string strEigyoCd)
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパスとファイル名を追加
            lstSQL.Add("A0170_ShukoShoninInput");
            lstSQL.Add("ShukoShoninInput_SELECT_GRID");

            //追加のWHERE句を入れる用
            string strSQLadd = "";

            //営業所コードがある場合
            if (strEigyoCd != "")
            {
                strSQLadd = "AND 出庫倉庫 = '" + strEigyoCd + "'";
            }

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                string strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(dtSetCd_B);
                }

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput, strSQLadd);

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLInput);

                return(dtSetCd_B);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
Example #14
0
        ///<summary>
        ///getDatagridView
        ///データグリッドビュー表示
        ///</summary>
        public DataTable getDatagridView(Boolean blnAll)
        {
            //データグリッドビューを入れる用
            DataTable dtGetTableGrid = new DataTable();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパスとファイル名を入れる用
                List <string> lstStringSQL = new List <string>();

                //SQL文のタイトルを取得
                string strSQLName = "";

                //削除されているもの以外
                if (blnAll == false)
                {
                    strSQLName = "ShohizeiritsuList_View";
                }
                //全て
                else
                {
                    strSQLName = "ShohizeiritsuListAll_View";
                }

                //SQLファイルのパスとファイル名を追加
                lstStringSQL.Add("Common");
                lstStringSQL.Add("CommonForm");
                lstStringSQL.Add(strSQLName);

                //SQL発行
                OpenSQL opensql = new OpenSQL();

                //SQLファイルのパス取得
                string strSQLInput = opensql.setOpenSQL(lstStringSQL);

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput);

                //検索データを表示
                dtGetTableGrid = dbconnective.ReadSql(strSQLInput);

                return(dtGetTableGrid);
            }
            catch (Exception e)
            {
                throw (e);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
        /// <summary>
        ///     updSetteiTanka
        ///     設定単価を更新
        /// </summary>
        /// <param name = "lstItem">
        ///     検索条件格納しているLIST
        ///     lstItem[0] 基準在庫日,
        ///     lstItem[1] 設定単価,
        ///     lstItem[2] 仮掛率,
        ///     lstItem[3] 商品コード
        /// </param>
        public void updSetteiTanka(List <string> lstItem)
        {
            string setSql   = "";
            string kijunYmd = lstItem[0];   // 基準在庫日
            string settei   = lstItem[1];   // 設定単価
            string karikake = lstItem[2];   // 仮掛率
            string shohinCd = lstItem[3];   // 商品コード

            // SQLのパス指定用List
            List <string> listSqlPath = new List <string>();

            listSqlPath.Add("M1240_ShohinSiireKakakuSuii2");
            listSqlPath.Add("M1240_ShohinSiireKakakuSuii2_UPDATE_setteitanka");

            //strSql = " UPDATE 商品仕入単価履歴TMP2";
            //strSql += " SET 仮単価 = " + decimal.Parse(lstItem[1]).ToString();

            // 仮掛率が空でない場合
            if (!karikake.Equals(""))
            {
                setSql += " ,仮掛率 = " + karikake;
            }

            //strSql += " WHERE 在庫年月日='" + lstItem[0] + "'";
            //strSql += " AND 商品コード='" + lstItem[3] + "'";

            DBConnective dbconnective = new DBConnective();

            try
            {
                // トランザクション開始
                dbconnective.BeginTrans();

                OpenSQL opensql = new OpenSQL();
                // sqlファイルからSQL文を取得
                string strSqltxt = opensql.setOpenSQL(listSqlPath);
                string sql       = string.Format(strSqltxt, kijunYmd, settei, setSql, shohinCd);

                // 更新
                dbconnective.RunSql(sql);

                // コミット
                dbconnective.Commit();
            }
            catch
            {
                // ロールバック処理
                dbconnective.Rollback();
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
        }
        public DataTable getHachuGrid2(string strHachuGrid)
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパスとファイル名を追加
            lstSQL.Add("A0100_HachuInput");
            lstSQL.Add("HachuInput_SELECT_GRID");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                string strSQLInput = "";

                strSQLInput += "SELECT a.発注番号,";
                strSQLInput += "       CASE WHEN a.印刷フラグ = 1 THEN '済' ELSE '' END as 印刷フラグ,";
                strSQLInput += "       a.注番,";
                strSQLInput += "       dbo.f_getメーカー名(a.メーカーコード) as メーカー名,";
                strSQLInput += "       dbo.f_get中分類名(a.大分類コード, a.中分類コード) as 中分類名,";
                strSQLInput += "       RTRIM(ISNULL(a.C1, '')) as 型番,";
                strSQLInput += "       a.発注数量,a.納期,";
                strSQLInput += "       a.仕入先名称 AS 仕入先名";
                strSQLInput += "  FROM 発注 a";
                strSQLInput += " WHERE 仕入先コード = '" + strHachuGrid + "'";
                strSQLInput += "   AND a.削除 = 'N'";
                strSQLInput += "   AND((a.発注数量 <> 0";
                strSQLInput += "        AND((a.仕入済数量 = 0) OR (abs(a.仕入済数量) < abs(a.発注数量))))";
                strSQLInput += "    OR a.印刷フラグ != '1')";
                strSQLInput += " ORDER BY a.納期";

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLInput);

                return(dtSetCd_B);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
Example #17
0
        ///<summary>
        ///getShohin
        ///商品コードから商品データを取得(編集登録メッセージ表示用)
        ///</summary>
        public DataTable getShohin(string strShohinCd, Boolean blHontorokuData)
        {
            DataTable dtShohin = new DataTable();

            //データ渡し用
            List <string> lstStringSQL = new List <string>();

            //商品の処理
            lstStringSQL = new List <string>();

            lstStringSQL.Add("M1030_Shohin");

            //本登録データの場合
            if (blHontorokuData)
            {
                lstStringSQL.Add("Shohin_Data_SELECT");
            }
            else
            {
                lstStringSQL.Add("Shohin_DataKari_SELECT");
            }

            OpenSQL opensql = new OpenSQL();

            //SQLのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                string strSQLSelect = opensql.setOpenSQL(lstStringSQL);

                //パスがなければ返す
                if (strSQLSelect == "")
                {
                    return(dtShohin);
                }

                strSQLSelect = string.Format(strSQLSelect, strShohinCd); //商品コード

                dtShohin = dbconnective.ReadSql(strSQLSelect);

                return(dtShohin);
            }
            catch (Exception ex)
            {
                new CommonException(ex);
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
        }
        ///<summary>
        ///updZaikohinHachu
        ///在庫品発注の削除フラグを立てる
        ///</summary>
        public void updZaikohinHachu(string strHachuban)
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //データ渡し用
            lstSQL.Add("A1540_ZaikohinHachu");
            lstSQL.Add("ZaikohinHachu_SakujoFlg_UPDATE");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            //トランザクション開始
            dbconnective.BeginTrans();
            try
            {
                //SQLファイルのパス取得
                string strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return;
                }

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput, strHachuban);

                //SQL接続後、
                dbconnective.RunSql(strSQLInput);

                //コミット
                dbconnective.Commit();
                return;
            }
            catch (Exception ex)
            {
                //ロールバック開始
                dbconnective.Rollback();
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
Example #19
0
        ///<summary>
        ///getTantoshaCd
        ///担当者データの取得
        ///</summary>
        public DataTable getTantoshaCd(string strUserID)
        {
            //SQL実行時に取り出したデータを入れる用
            DataTable dtTantoshaCd = new DataTable();

            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパス用(フォーマット後)
            string strSQLInput = "";

            //SQLファイルのパスとファイル名を追加
            lstSQL.Add("A0030_ShireInput");
            lstSQL.Add("ShireInput_Tantosha_SELECT");

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(dtTantoshaCd);
                }

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput,
                                            strUserID   //ログインID
                                            );

                //データ取得(ここから取得)
                dtTantoshaCd = dbconnective.ReadSql(strSQLInput);
            }
            catch (Exception ex)
            {
                //ロールバック開始
                dbconnective.Rollback();
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
            return(dtTantoshaCd);
        }
        ///<summary>
        ///updTorikeshi
        ///取り消し項目を反映
        ///</summary>
        public void updTorikeshi(string strYM, string strShohinCd)
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパス用(フォーマット後)
            string strSQLInput = "";

            //SQLファイルのパスとファイル名を追加
            lstSQL.Add("B0250_MOnyuryoku");
            lstSQL.Add("MOnyuryoku_UPDATE_Torikeshi");

            //SQL接続
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            //トランザクション開始
            dbconnective.BeginTrans();
            try
            {
                //SQLファイルのパス取得
                strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return;
                }

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput, strYM, strShohinCd);

                //SQL接続、追加
                dbconnective.RunSql(strSQLInput);

                //コミット開始
                dbconnective.Commit();
            }
            catch (Exception ex)
            {
                //ロールバック開始
                dbconnective.Rollback();
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
Example #21
0
        /// <summary>
        /// getKaishajyoken
        /// 会社処理条件情報取得処理
        /// </summary>
        public DataTable getKaishajyoken(string strKaisyaCode)
        {
            // SQL埋め込み用リスト生成
            List <string> stringSQLAry = new List <string>();

            // SQLファイル名格納
            string strSQLName = "M1000_Kaishajyoken_SELECT_LEAVE";

            //SQLファイル情報格納
            stringSQLAry.Add("M1000_Kaishajyoken");
            stringSQLAry.Add(strSQLName);

            // 会社処理条件情報格納用DataTable生成
            DataTable dtKaishajyokenInfo = new DataTable();

            // データベース接続用クラス宣言
            OpenSQL      opensql      = new OpenSQL();
            DBConnective dbconnective = new DBConnective();

            try
            {
                // SQLファイル内容取得
                string strSQLInput = opensql.setOpenSQL(stringSQLAry);

                if (strSQLInput == "")
                {
                    return(dtKaishajyokenInfo);
                }

                //配列設定
                string[] aryStr = { strKaisyaCode };

                // 会社処理条件情報用SQL文作成
                strSQLInput = string.Format(strSQLInput, aryStr);

                // 会社処理条件情報取得
                dtKaishajyokenInfo = dbconnective.ReadSql(strSQLInput);

                return(dtKaishajyokenInfo);
            }
            // データベース例外処理をキャッチ
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
        }
        ///<summary>
        ///getPrintData
        ///印刷前のデータ取得
        ///</summary>
        public DataTable getPrintData()
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパス用(フォーマット後)
            string strSQLInput = "";

            //SQLファイルのパスとファイル名を追加
            lstSQL.Add("M1070_Torihikisaki");
            lstSQL.Add("Torihikisaki_PrintData_SELECT");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL接続
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(dtSetCd_B);
                }

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput);

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLInput);

                return(dtSetCd_B);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
        ///<summary>
        ///setRirekiData
        ///履歴データの取り出し
        ///</summary>
        public DataTable getRirekiData(string strShohinCd)
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパス用(フォーマット後)
            string strSQLInput = "";

            //SQLファイルのパスとファイル名を追加
            lstSQL.Add("B0250_MOnyuryoku");
            lstSQL.Add("MOnyuryoku_SELECT_GetDataGridView_Rireki");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL接続
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(dtSetCd_B);
                }

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput, strShohinCd);

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLInput);

                return(dtSetCd_B);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
Example #24
0
        ///<summary>
        ///getTxtMakerTextLeave
        ///code入力箇所からフォーカスが外れた時
        ///</summary>
        public DataTable getTxtMakerTextLeave(string strMakerCD)
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパス用(フォーマット後)
            string strSQLInput = "";

            //SQLファイルのパスとファイル名を追加
            lstSQL.Add("Common");
            lstSQL.Add("C_LIST_Maker_SELECT_LEAVE");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(dtSetCd_B);
                }

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput, strMakerCD);

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLInput);

                return(dtSetCd_B);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
Example #25
0
        ///<summary>
        ///getMenuSet
        ///各ユーザー用のデータを取得
        ///</summary>
        public DataTable getMenuSet(string strUserID)
        {
            //データ渡し用
            List <string> lstSQL = new List <string>();

            //データ渡し用
            lstSQL.Add("Z1500_MyMenuSet");
            lstSQL.Add("MyMenuSet_MenuSet_SELECT");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            //トランザクション開始
            dbconnective.BeginTrans();
            try
            {
                //SQLファイルのパス取得
                string strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(dtSetCd_B);
                }

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput, strUserID);

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLInput);

                return(dtSetCd_B);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
Example #26
0
        // コンストラクタ内で処理
        public Tantosya_Kengen(string loginId)
        {
            DataTable dtKengen = new DataTable();

            // SQLのパス指定用List
            List <string> listSqlPath = new List <string>();

            listSqlPath.Add("Common");
            listSqlPath.Add("C_TantoshaKengen_Select");

            DBConnective dbconnective = new DBConnective();

            try
            {
                OpenSQL opensql = new OpenSQL();
                // sqlファイルからSQL文を取得
                string strSqltxt = opensql.setOpenSQL(listSqlPath);
                string sql       = string.Format(strSqltxt, loginId);

                // SELECT結果をDataTableへ
                dtKengen = dbconnective.ReadSql(sql);

                if (dtKengen.Rows.Count != 0)
                {
                    master     = dtKengen.Rows[0]["マスタ権限"].ToString();
                    etsuran    = dtKengen.Rows[0]["閲覧権限"].ToString();
                    riekiritsu = dtKengen.Rows[0]["利益率権限"].ToString();
                    eigyocd    = dtKengen.Rows[0]["営業所コード"].ToString();
                    groupcd    = dtKengen.Rows[0]["グループコード"].ToString();
                }
                else
                {
                    master     = "0";
                    etsuran    = "0";
                    riekiritsu = "0";
                    eigyocd    = "0000";
                    groupcd    = "0000";
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
        }
Example #27
0
        ///<summary>
        ///FormMove
        ///仕入単価取得用(仕入入力画面で使用)
        ///カラム論理名
        ///</summary>
        public DataTable getShireTanka(string strShohinCd)
        {
            DataTable dtShireTanka = new DataTable();

            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQLSelect = new List <string>();

            //SQLファイルのパスとファイル名を追加(メニュー権限取得)
            lstSQLSelect.Add("Common");
            lstSQLSelect.Add("C_LIST_Shohin_SELECT_ShireTanka");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得(メニュー権限取得)
                string strSQLSelect = opensql.setOpenSQL(lstSQLSelect);

                //パスがなければ返す
                if (strSQLSelect == "")
                {
                    return(dtShireTanka);
                }

                strSQLSelect = string.Format(strSQLSelect, strShohinCd);

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLSelect);

                return(dtShireTanka);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
Example #28
0
        ///<summary>
        ///updTxtGroupLeave
        ///code入力箇所からフォーカスが外れた時
        ///</summary>
        public DataTable updTxtGroupLeave(string strGrouop)
        {
            //データ渡し用
            List <string> stringSQLAry = new List <string>();

            //データ渡し用
            stringSQLAry.Add("Common");
            stringSQLAry.Add("C_LIST_GroupCd_SELECT_LEAVE");

            //SQL実行時に取り出したデータを入れる用
            DataTable dtSetCd_B = new DataTable();

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                string strSQLInput = opensql.setOpenSQL(stringSQLAry);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(dtSetCd_B);
                }

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput, strGrouop);

                //SQL接続後、該当データを取得
                dtSetCd_B = dbconnective.ReadSql(strSQLInput);

                return(dtSetCd_B);
            }
            catch (Exception ex)
            {
                new CommonException(ex);
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
        ///<summary>
        ///getOpenData
        ///初期表示時のグリッド
        ///</summary>
        public DataTable getOpenData()
        {
            //SQL実行時に取り出したデータを入れる用
            DataTable dtTantoshaCd = new DataTable();

            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパス用(フォーマット後)
            string strSQLInput = "";

            //SQLファイルのパスとファイル名を追加
            lstSQL.Add("A1540_ZaikohinHachu");
            lstSQL.Add("ZaikohinHachu_SELECT_OpenGRID");

            //SQL発行
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパス取得
                strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return(dtTantoshaCd);
                }

                //データ取得(ここから取得)
                dtTantoshaCd = dbconnective.ReadSql(strSQLInput);
            }
            catch (Exception ex)
            {
                //ロールバック開始
                dbconnective.Rollback();
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
            return(dtTantoshaCd);
        }
        ///<summary>
        ///setRirekiData
        ///履歴データの削除と保存
        ///</summary>
        public void setRirekiData(List <string> lstString)
        {
            //SQLファイルのパスとファイル名を入れる用
            List <string> lstSQL = new List <string>();

            //SQLファイルのパス用(フォーマット後)
            string strSQLInput = "";

            //SQL接続
            OpenSQL opensql = new OpenSQL();

            //接続用クラスのインスタンス作成
            DBConnective dbconnective = new DBConnective();

            try
            {
                //SQLファイルのパスとファイル名を追加
                lstSQL.Add("B0250_MOnyuryoku");
                lstSQL.Add("MOnyuryoku_DELETE_INSERT_MOtukibetu");

                //SQLファイルのパス取得
                strSQLInput = opensql.setOpenSQL(lstSQL);

                //パスがなければ返す
                if (strSQLInput == "")
                {
                    return;
                }

                //SQLファイルと該当コードでフォーマット
                strSQLInput = string.Format(strSQLInput, lstString[0], lstString[1], lstString[2], lstString[3]);

                //SQL接続後、該当データを取得
                dbconnective.RunSql(strSQLInput);

                return;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }