コード例 #1
0
        /// <summary>
        /// getGetsumatsu
        /// 月末を取得
        /// </summary>
        public DataTable getGetsumatsu(string strSimekiriYmd)
        {
            string    strSql;
            DataTable dtGetsumatsu = new DataTable();

            strSql = " SELECT dbo.f_前月翌日('" + strSimekiriYmd + "') ";

            DBConnective dbconnective = new DBConnective();

            try
            {
                // 検索データをテーブルへ格納
                dtGetsumatsu = dbconnective.ReadSql(strSql);

                return(dtGetsumatsu);
            }
            catch
            {
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
        }
コード例 #2
0
        /// <summary>
        /// delRiekiritsu
        /// 表示中のマスタデータを削除する処理
        /// </summary>
        public void delRiekiritsu(List <string> lstDeleteItem)
        {
            DBConnective dbconnective = new DBConnective();

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

                // 商品分類別利益率設定マスタ削除_PROCを実行
                dbconnective.RunSql("商品分類別利益率設定マスタ削除_PROC " + lstDeleteItem[0] + ", '" + lstDeleteItem[1] + "'");

                // コミット
                dbconnective.Commit();
            }
            catch
            {
                // ロールバック処理
                dbconnective.Rollback();
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
            return;
        }
コード例 #3
0
        ///<summary>
        ///updMOdataKakutei
        ///MOデータ確定処理
        ///</summary>
        public void updMOdataKakutei(List <string> lstStringMOKakutei)
        {
            List <string> lstTableName = new List <string>();

            lstTableName.Add("@年月度");
            lstTableName.Add("@商品コード");
            lstTableName.Add("@ユーザー名");

            DBConnective dbconnective = new DBConnective();

            //トランザクション開始
            dbconnective.BeginTrans();
            try
            {
                //MOデータ削除_PROCを実行
                dbconnective.RunSqlRe("MOデータ確定_PROC", CommandType.StoredProcedure, lstStringMOKakutei, lstTableName);

                //コミット
                dbconnective.Commit();
            }
            catch (Exception ex)
            {
                //ロールバック開始
                dbconnective.Rollback();
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
        }
コード例 #4
0
        /// <summary>
        /// getDate
        /// 日付制限テーブルから最小年月日、最大年月日を取得
        /// </summary>
        public DataTable getDate(string strEigyoshoCd)
        {
            DataTable dtGetShiharai = new DataTable();
            string    strSql;

            strSql  = "SELECT 最小年月日, 最大年月日 FROM 日付制限 ";
            strSql += "WHERE 画面NO ='6' ";
            strSql += "AND 営業所コード ='" + strEigyoshoCd + "' ";

            DBConnective dbconnective = new DBConnective();

            try
            {
                // 検索データをテーブルへ格納
                dtGetShiharai = dbconnective.ReadSql(strSql);

                return(dtGetShiharai);
            }
            catch
            {
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
        }
コード例 #5
0
        ///<summary>
        ///getDenpyoMeisai
        ///伝票明細の取得
        ///</summary>
        public DataTable getDenpyoMeisai(string s)
        {
            DataTable dt = null;

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

            try
            {
                string strSQL = "SELECT * FROM 出庫明細 WHERE 伝票番号= " + s + " AND 削除='N' ORDER BY 行番号";

                dt = con.ReadSql(strSQL);
            }
            catch (Exception ex)
            {
                //ロールバック開始
                con.Rollback();
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                con.DB_Disconnect();
            }
            return(dt);
        }
コード例 #6
0
        /// <summary>
        ///     getZenzan
        ///     前月残高を取得
        /// </summary>
        /// <param name="lstString">
        ///     listString[0]:得意先コードStart
        ///     listString[1]:日付Start
        ///     listString[2]:日付End
        /// </param>
        public DataTable getZenzan(List <string> lstString)
        {
            DataTable dtGetTableGrid = new DataTable();

            string strSQLInput = "";

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


            //SQL文 請求履歴

            strSQLInput = strSQLInput + " SELECT dbo.f_get売掛残高一覧表_繰越残高FROM取引先経理情報( '" + lstString[0] + "'" + ",dbo.f_月初日('" + lstString[1] + "')) AS 前月残高 ";

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

            try
            {
                dtGetTableGrid = dbconnective.ReadSql(strSQLInput);
            }
            catch (Exception ex)
            {
                new CommonException(ex);
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }

            return(dtGetTableGrid);
        }
コード例 #7
0
ファイル: Z0000_B.cs プロジェクト: kawabata-neolis/KATO
        ///<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();
            }
        }
コード例 #8
0
        /// <summary>
        /// getSeikyuRireki
        /// 請求履歴を取得
        /// </summary>
        public DataTable getSeikyuRireki(List <string> lstString)
        {
            DataTable dtGetTableGrid = new DataTable();

            string strSQLInput = "";

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


            //SQL文 請求履歴

            strSQLInput = strSQLInput + " SELECT 請求年月日, 入金予定年月日, 前回請求額, 入金額, 繰越額, 売上額, 消費税, 今回請求額 ";

            strSQLInput = strSQLInput + " FROM 請求履歴 WHERE 得意先コード = '" + lstString[0] + "' ORDER BY 請求年月日 DESC ";

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

            try
            {
                dtGetTableGrid = dbconnective.ReadSql(strSQLInput);
            }
            catch (Exception ex)
            {
                new CommonException(ex);
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }

            return(dtGetTableGrid);
        }
コード例 #9
0
        /// <summary>
        /// getNyukinData
        /// 入金テーブルから全データを取得する。
        /// </summary>
        public DataTable getNyukinData(List <string> lstString)
        {
            DataTable dtGetTableGrid = new DataTable();

            string strSQLInput = "";

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


            // SQL文 請求履歴

            strSQLInput = strSQLInput + " SELECT * ";

            strSQLInput = strSQLInput + " FROM 入金 WHERE 伝票番号 = '" + lstString[0] + "' AND 削除 = 'N' ORDER BY 行番号 ";

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

            try
            {
                dtGetTableGrid = dbconnective.ReadSql(strSQLInput);
            }
            catch (Exception ex)
            {
                new CommonException(ex);
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }

            return(dtGetTableGrid);
        }
コード例 #10
0
        /// <summary>
        ///     suii2_Proc
        ///     商品仕入価格推移2_PROCを実行
        /// </summary>
        /// <param name = "lstItem">
        ///     検索条件格納しているLIST
        ///     lstItem[0] 基準在庫日,
        ///     lstItem[1] 期間From,
        ///     lstItem[2] 期間To,
        ///     lstItem[3] ユーザー名
        /// </param>
        public void suii2_Proc(List <string> lstItem)
        {
            DBConnective dbconnective = new DBConnective();

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

                string strProc = "商品仕入価格推移2_PROC '" + lstItem[0] + "', '" + lstItem[1] +
                                 "', '" + lstItem[2] + "', '" + lstItem[3] + "'";

                // 商品仕入価格推移2_PROCを実行
                dbconnective.RunSql(strProc);

                // コミット
                dbconnective.Commit();
            }
            catch
            {
                // ロールバック処理
                dbconnective.Rollback();
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
            return;
        }
コード例 #11
0
        public string getChubanName(string cd)
        {
            DataTable dtRet    = null;
            string    strQuery = "";

            strQuery += "SELECT 注番文字";
            strQuery += "  FROM 担当者";
            strQuery += " WHERE 削除     = 'N'";
            strQuery += "   AND 担当者コード     = '" + cd + "'";

            DBConnective dbCon = new DBConnective();

            try
            {
                dtRet = dbCon.ReadSql(strQuery);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbCon.DB_Disconnect();
            }

            string ret = ".";

            if (dtRet != null && dtRet.Rows.Count > 0)
            {
                ret = dtRet.Rows[0]["注番文字"].ToString();
            }

            return(ret);
        }
コード例 #12
0
        /// <summary>
        ///     updCyokkinTanka_Proc
        ///     在庫一覧データ作成_PROCを実行
        /// </summary>
        /// <param name = "strKijunYmd">
        ///     基準在庫日
        /// </param>
        public void addZaikoData_Proc(string strKijunYmd)
        {
            DBConnective dbconnective = new DBConnective();

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

                // 在庫一覧データ作成_PROCを実行
                dbconnective.RunSql("在庫一覧データ作成_PROC '" + strKijunYmd + "'");

                // コミット
                dbconnective.Commit();
            }
            catch
            {
                // ロールバック処理
                dbconnective.Rollback();
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
            return;
        }
コード例 #13
0
        /// <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();
            }
        }
コード例 #14
0
        ///<summary>
        ///addTanaoroshi
        ///テキストボックス内のデータをDBに登録
        ///</summary>
        public void addTanaoroshi(List <string> lstString)
        {
            string strSQLInput = null;

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

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

            try
            {
                strSQLInput = null;

                strSQLInput = "棚卸入力更新_PROC '" + lstString[0] + "','" + lstString[1] + "','" + lstString[2] + "','" + lstString[3] + "','" + lstString[4] + "','" + lstString[5] + "','ADMIN'";

                dbconnective.RunSql(strSQLInput);

                //コミット開始
                dbconnective.Commit();
            }
            catch (Exception ex)
            {
                //ロールバック開始
                dbconnective.Rollback();
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
            return;
        }
コード例 #15
0
        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);
        }
コード例 #16
0
        /// <summary>
        /// getMinDenpyoNo
        /// 伝票番号の最小値を取得
        /// </summary>
        public DataTable getMinDenpyoNo(string strDenpyoNo)
        {
            DataTable dtGetDenpyoNo = new DataTable();

            // 伝票番号がある場合
            if (!strDenpyoNo.Equals(""))
            {
                string strSql = "SELECT MIN(伝票番号) AS 最小値 FROM 入金 WHERE  削除='N' AND 伝票番号 > " + strDenpyoNo;

                DBConnective dbconnective = new DBConnective();
                try
                {
                    // 検索データをテーブルへ格納
                    dtGetDenpyoNo = dbconnective.ReadSql(strSql);
                }
                catch
                {
                    throw;
                }
                finally
                {
                    dbconnective.DB_Disconnect();
                }
            }
            return(dtGetDenpyoNo);
        }
コード例 #17
0
        ///<summary>
        ///getNyukinSonota
        ///入金その他を取得
        ///</summary>
        /// <param name="lstString">
        ///     listString[0]:得意先コードStart
        ///     listString[1]:日付Start
        ///     listString[2]:日付End
        /// </param>
        public DataTable getNyukinSonota(List <string> lstString)
        {
            DataTable dtGetTableGrid = new DataTable();

            string strSQLInput = "";

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


            //SQL文 入金その他

            strSQLInput = strSQLInput + " SELECT dbo.f_get売掛残高一覧表_入金_その他( '" + lstString[0] + "','" + lstString[1] + "','" + lstString[2] + "') AS 入金その他 ";

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

            try
            {
                dtGetTableGrid = dbconnective.ReadSql(strSQLInput);
            }
            catch (Exception ex)
            {
                new CommonException(ex);
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }

            return(dtGetTableGrid);
        }
コード例 #18
0
        /// <summary>
        /// delShiharai
        /// 在庫一覧表データ作成処理
        /// </summary>
        public void addZaikoIchiranCreate(List <string> lstItem)
        {
            DBConnective dbconnective = new DBConnective();

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

                string strProc = "在庫一覧表データ作成_PROC '" + lstItem[0] + "', '" + lstItem[1] + "', '" +
                                 lstItem[2] + "', '" + lstItem[3] + "', '" + lstItem[4] + "'";

                // 在庫一覧表データ作成_PROCを実行
                dbconnective.ReadSql(strProc);

                // コミット
                dbconnective.Commit();
            }
            catch
            {
                // ロールバック処理
                dbconnective.Rollback();
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
            return;
        }
コード例 #19
0
ファイル: Z0000_B.cs プロジェクト: kawabata-neolis/KATO
        public DataTable getTime(string cd)
        {
            DataTable dt = null;

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

            con.DB_Connect();

            try
            {
                string st = "select * from 担当者利用時刻 where 担当者コード = '" + cd + "'";
                dt = con.ReadSql(st);
            }
            catch (Exception ex)
            {
                //ロールバック開始
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                con.DB_Disconnect();
            }

            return(dt);
        }
コード例 #20
0
        /// <summary>
        /// getEigyoCd
        /// 営業コードを取得
        /// </summary>
        public DataTable getEigyoCd(string strUserId)
        {
            DataTable dtGetTableGrid = new DataTable();
            string    strSQLInput    = "";

            // SQL文 営業所コード
            strSQLInput = strSQLInput + " SELECT ";
            strSQLInput = strSQLInput + " 営業所コード ";

            strSQLInput = strSQLInput + " FROM ";
            strSQLInput = strSQLInput + " 担当者  ";

            strSQLInput = strSQLInput + " WHERE ";
            strSQLInput = strSQLInput + " ログインID= '" + strUserId + "' ";
            strSQLInput = strSQLInput + " AND 削除='N' ";

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

            try
            {
                dtGetTableGrid = dbconnective.ReadSql(strSQLInput);
            }
            catch
            {
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
            return(dtGetTableGrid);
        }
コード例 #21
0
        /// <summary>
        /// getShiharai
        /// 伝票番号の最大値を取得
        /// </summary>
        public DataTable getMaxDenpyoNo(string strDenpyoNo)
        {
            DataTable dtGetDenpyoNo = new DataTable();

            string strSql = "SELECT MAX(伝票番号) AS 最大値 FROM 支払 WHERE  削除='N'";

            // 伝票番号がある場合
            if (!strDenpyoNo.Equals(""))
            {
                strSql += " AND 伝票番号 < " + strDenpyoNo;
            }

            DBConnective dbconnective = new DBConnective();

            try
            {
                // 検索データをテーブルへ格納
                dtGetDenpyoNo = dbconnective.ReadSql(strSql);
            }
            catch
            {
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }

            return(dtGetDenpyoNo);
        }
コード例 #22
0
        /// <summary>
        /// getShohinData
        /// 商品データを取得
        /// </summary>
        public DataTable getShohinData(List <string> lstString)
        {
            DataTable dtGetTableGrid = new DataTable();
            string    strSQLInput    = "";

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

            // SQL文 商品別利益率

            strSQLInput = strSQLInput + " SELECT * FROM 商品 WHERE 商品コード='" + lstString[0] + "' AND 削除='N' ";

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

            try
            {
                dtGetTableGrid = dbconnective.ReadSql(strSQLInput);
            }
            catch (Exception ex)
            {
                new CommonException(ex);
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
            return(dtGetTableGrid);
        }
コード例 #23
0
        /// <summary>
        /// delShiharai
        /// 表示中の支払を全削除する処理
        /// </summary>
        public void delShiharai(string[] strDeleteItem)
        {
            DBConnective dbconnective = new DBConnective();

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

                // 支払全削除_PROCを実行
                DataTable dtRet = dbconnective.ReadSql("支払全削除_PROC '" + strDeleteItem[0] + "', '" + strDeleteItem[1] + "'");

                // コミット
                dbconnective.Commit();
            }
            catch (Exception ex)
            {
                // ロールバック処理
                dbconnective.Rollback();
                new CommonException(ex);
                //throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
            return;
        }
コード例 #24
0
        /// <summary>
        /// getUriage
        /// 得意先別売上管理表_PROCを実行
        /// </summary>
        public DataTable getUriage(List <string> lstDataName)
        {
            DataTable dtRet = new DataTable();

            List <string> lstTableName = new List <string>();

            lstTableName.Add("@開始年月日");
            lstTableName.Add("@終了年月日");
            lstTableName.Add("@開始グループコード");
            lstTableName.Add("@終了グループコード");
            lstTableName.Add("@開始担当者コード");
            lstTableName.Add("@終了担当者コード");
            lstTableName.Add("@開始得意先コード");
            lstTableName.Add("@終了得意先コード");
            lstTableName.Add("@開始営業所コード");
            lstTableName.Add("@終了営業所コード");

            DBConnective dbconnective = new DBConnective();

            try
            {
                // 請求明細書_PROCを実行
                dtRet = dbconnective.RunSqlReDT("得意先別売上管理表_PROC", CommandType.StoredProcedure, lstDataName, lstTableName, "@結果");

                return(dtRet);
            }
            catch
            {
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
        }
コード例 #25
0
        ///<summary>
        ///getDenpyoData
        ///伝票データの取得
        ///</summary>
        public DataTable getDenpyoData(string s)
        {
            DataTable dt = null;

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

            try
            {
                string strSQL = "SELECT 伝票番号, CONVERT(VARCHAR, 伝票年月日, 111) as 伝票年月日, 仕入先コード, 取引区分, 担当者コード, 営業所コード FROM 出庫ヘッダ WHERE 伝票番号= " + s + " AND 削除='N'";

                dt = con.ReadSql(strSQL);
            }
            catch (Exception ex)
            {
                //ロールバック開始
                con.Rollback();
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                con.DB_Disconnect();
            }
            return(dt);
        }
コード例 #26
0
        ///<summary>
        ///updShukoInputDel
        ///データの削除
        ///</summary>
        public void updShukoInputDel(List <string> lstStringData, List <string> lstStringTanblename)
        {
            //SQL用に移動
            DBConnective dbconnective = new DBConnective();

            //トランザクション開始
            dbconnective.BeginTrans();
            try
            {
                //プロシージャ(戻り値なし)用のメソッドに投げる
                dbconnective.RunSql("出庫依頼入力削除_PROC", CommandType.StoredProcedure, lstStringData, lstStringTanblename);

                //コミット
                dbconnective.Commit();
            }
            catch (Exception ex)
            {
                //ロールバック開始
                dbconnective.Rollback();
                throw (ex);
            }
            finally
            {
                //トランザクション終了
                dbconnective.DB_Disconnect();
            }
            return;
        }
コード例 #27
0
        /// <summary>
        /// getZengetuYokugetuSyutoku
        /// 締切年月日の前月翌月を取得
        /// </summary>
        public DataTable getZengetuYokugetuSyutoku(List <string> lstString)
        {
            DataTable dtGetTableGrid = new DataTable();

            string strSQLInput = "";

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


            // SQL文 請求履歴

            strSQLInput = strSQLInput + " SELECT dbo.f_前月翌日('" + lstString[0] + "') AS 前月翌月 ";

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

            try
            {
                dtGetTableGrid = dbconnective.ReadSql(strSQLInput);
            }
            catch (Exception ex)
            {
                new CommonException(ex);
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }

            return(dtGetTableGrid);
        }
コード例 #28
0
        ///<summary>
        ///getSotozei
        ///外税を取得
        ///</summary>
        /// <param name="lstString">
        ///     listString[0]:得意先コードStart
        ///     listString[1]:日付Start
        ///     listString[2]:日付End
        /// </param>
        public DataTable getSotozei(List <string> lstString)
        {
            DataTable dtGetTableGrid = new DataTable();

            string strSQLInput = "";

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


            //SQL文 外税

            strSQLInput = strSQLInput + " SELECT dbo.f_get売掛残高一覧表_月間消費税( '" + lstString[0] + "','" + lstString[2] + "'," + lstString[3] + ") AS 請求消費税 ";

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

            try
            {
                dtGetTableGrid = dbconnective.ReadSql(strSQLInput);
            }
            catch (Exception ex)
            {
                new CommonException(ex);
                throw (ex);
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }

            return(dtGetTableGrid);
        }
コード例 #29
0
        // 伝票名から伝票番号を取得
        public string getDenpyoNo()
        {
            List <string> lstTableName = new List <string>();

            lstTableName.Add("@テーブル名");

            List <string> lstDataName = new List <string>();

            lstDataName.Add("支払伝票");

            string strRet;

            DBConnective dbconnective = new DBConnective();

            try
            {
                // get伝票番号_PROC"を実行
                strRet = dbconnective.RunSqlRe("get伝票番号_PROC", CommandType.StoredProcedure, lstDataName, lstTableName, "@番号");
            }
            catch
            {
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }

            return(strRet);
        }
コード例 #30
0
        /// <summary>
        /// getSeikyuRireki
        /// 請求履歴を取得
        /// </summary>
        public DataTable getSeikyuRireki(List <string> lstItem)
        {
            string    strSql;
            DataTable dtSeikyuRireki = new DataTable();

            strSql  = " SELECT COUNT(*) FROM 請求履歴 ";
            strSql += " WHERE 得意先コード>= '" + lstItem[0] + "'";
            strSql += " AND 得意先コード<= '" + lstItem[1] + "'";
            strSql += " AND 請求年月日= '" + lstItem[2] + "'";

            DBConnective dbconnective = new DBConnective();

            try
            {
                // 検索データをテーブルへ格納
                dtSeikyuRireki = dbconnective.ReadSql(strSql);

                return(dtSeikyuRireki);
            }
            catch
            {
                throw;
            }
            finally
            {
                dbconnective.DB_Disconnect();
            }
        }