コード例 #1
0
ファイル: IVM043_BCO.cs プロジェクト: ChiangHanLung/PIC_VDS
        public void CheckStockTakeItem(ArrayList ParameterList, out string strMsg, out string strResult)
        {
            VDS_IVM043_DBO dbo = new VDS_IVM043_DBO(ref USEDB);
            try
            {
                dbo.CheckStockTakeItem(ParameterList, out strMsg, out strResult);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
ファイル: IVM043_BCO.cs プロジェクト: ChiangHanLung/PIC_VDS
        public DataTable CheckPeriod(string strItem, string strPeriod)
        {
            VDS_IVM043_DBO dbo = new VDS_IVM043_DBO(ref USEDB);

            try
            {
                return dbo.CheckPeriod(strItem, strPeriod);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }        
コード例 #3
0
ファイル: IVM043_BCO.cs プロジェクト: ChiangHanLung/PIC_VDS
        public void GetCostByItem(string strItem, string strPeriod, out string strID)
        {
            VDS_IVM043_DBO dbo = new VDS_IVM043_DBO(ref USEDB);

            try
            {
                dbo.GetCostByItem(strItem, strPeriod, out strID);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
ファイル: IVM043_BCO.cs プロジェクト: ChiangHanLung/PIC_VDS
        public DataTable CheckDETL(ArrayList Para)
        {
            VDS_IVM043_DBO dbo = new VDS_IVM043_DBO(ref USEDB);

            try
            {            
                return dbo.CheckDETL(Para);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
0
ファイル: IVM043_BCO.cs プロジェクト: ChiangHanLung/PIC_VDS
        public bool SaveData(DataTable dtData, ArrayList ParameterList)
        {
            bool bResult = false;

            try
            {
                string strSTOCKTAKE_NO = ParameterList[0].ToString();
                string strUID = ParameterList[1].ToString();
                string strPID = ParameterList[2].ToString();
                Conn = USEDB.CreateConnection();
                Conn.Open();
                DBT = Conn.BeginTransaction();

                DBO.VDS_IVM043_DBO db = new VDS_IVM043_DBO(ref USEDB);

                ArrayList Para = new ArrayList();
                for (int i = 0; i < dtData.Rows.Count; i++)
                {
                    //V_STOCKTAKE_NO     
                    //V_LOCATE_NO        
                    //V_LOCATE_SECTION   
                    //V_ITEM             
                    //V_PERIOD
                    Para.Clear();
                    Para.Add(strSTOCKTAKE_NO);
                    Para.Add(dtData.Rows[i]["LOCATE_NO"].ToString());
                    Para.Add(dtData.Rows[i]["LOCATE_SECTION"].ToString());
                    Para.Add(dtData.Rows[i]["ITEM"].ToString());
                    Para.Add(dtData.Rows[i]["PERIOD"].ToString());
                    DataTable dtCheck = db.CheckDETL(Para);

                    if (dtCheck.Rows.Count > 0)
                    {
                        //N_ID             number,
                        //N_STOCKTAKE_QTY  number,
                        //V_NEW_UPDATEUID  varchar2,
                        //D_NEW_UPDATEDATE date,
                        //V_OLD_UPDATEUID  varchar2,
                        //D_OLD_UPDATEDATE date,
                        //V_OLD_CREATEUID  varchar2,
                        //D_OLD_CREATEDATE date
                        Para.Clear();
                        Para.Add(int.Parse(dtCheck.Rows[0]["ID"].ToString()));
                        Para.Add(int.Parse(dtData.Rows[i]["STOCKTAKE_QTY"].ToString()));
                        Para.Add(strUID);
                        Para.Add(DateTime.Now);
                        Para.Add(DBNull.Value);
                        Para.Add(DBNull.Value);
                        Para.Add(DBNull.Value);
                        Para.Add(DBNull.Value);
                        db.UpdStockTake(Para, DBT);
                    }
                    else
                    {
                        Para.Clear();
                        Para.Add(int.Parse(strPID));
                        Para.Add(dtData.Rows[i]["LOCATE_NO"].ToString() + dtData.Rows[i]["LOCATE_SECTION"].ToString());
                        Para.Add(dtData.Rows[i]["ITEM"].ToString());
                        Para.Add(dtData.Rows[i]["PERIOD"].ToString());
                        Para.Add(int.Parse(dtData.Rows[i]["STOCKTAKE_QTY"].ToString()));
                        Para.Add(decimal.Parse(dtData.Rows[i]["COST"].ToString()));
                        Para.Add(strUID);
                        Para.Add(DateTime.Now);
                        InsertStockTake(Para, DBT);
                    }

                }
                DBT.Commit();

                bResult = true;                
            }
            catch (Exception ex)
            {
                if (DBT != null)
                {
                    //獨立呼叫Transcation失敗
                    DBT.Rollback();
                }

                throw ex;
            }
            finally
            {

                //獨立呼叫Transcation,關閉連線
                if (Conn.State == ConnectionState.Connecting)
                {
                    Conn.Close();
                }
            }
            return bResult;
        }
コード例 #6
0
ファイル: IVM043_BCO.cs プロジェクト: ChiangHanLung/PIC_VDS
        public int InsertStockTake(ArrayList ParameterList, DbTransaction RootDBT)
        {
            int result;
            bool IsRootTranscation = false;
            DBO.VDS_IVM043_DBO db = new VDS_IVM043_DBO(ref USEDB);

            try
            {
                //判斷是否有傳入Root Transcation 
                IsRootTranscation = (RootDBT == null) ? true : false;

                #region 啟動交易或指定RootTranscation

                if (IsRootTranscation)
                {
                    //獨立呼叫啟動Transcation
                    Conn = USEDB.CreateConnection();
                    Conn.Open();
                    DBT = Conn.BeginTransaction();
                }
                else
                {
                    DBT = RootDBT;
                }

                #endregion

                result = db.InsertStockTake(ParameterList, RootDBT);

                #region 交易成功

                if (IsRootTranscation)
                {
                    //獨立呼叫Transcation成立
                    DBT.Commit();
                }

                #endregion
                return result;
            }
            catch (Exception ex)
            {
                #region 交易失敗

                if (IsRootTranscation)
                {
                    //獨立呼叫Transcation失敗
                    DBT.Rollback();
                }

                #endregion

                throw ex;
            }
            finally
            {
                #region 判斷是否關閉交易連線

                if (IsRootTranscation)
                {
                    //獨立呼叫Transcation,關閉連線
                    if (Conn.State == ConnectionState.Connecting)
                    {
                        Conn.Close();
                    }
                }

                #endregion

            }
        }
コード例 #7
0
ファイル: IVM043_BCO.cs プロジェクト: ChiangHanLung/PIC_VDS
        public int CreateStockTake(ArrayList ParameterList, out string strStockTakeNo, out string strID)
        {
            int result;
            DBO.VDS_IVM043_DBO db = new VDS_IVM043_DBO(ref USEDB);
            try
            {
                //獨立呼叫啟動Transcation
                Conn = USEDB.CreateConnection();
                Conn.Open();
                DBT = Conn.BeginTransaction();

                result = db.CreateStockTake(ParameterList, out strStockTakeNo, out strID);

                //獨立呼叫Transcation成立
                DBT.Commit();
                return result;
            }
            catch (Exception ex)
            {

                if (DBT != null)
                {
                    //獨立呼叫Transcation失敗
                    DBT.Rollback();
                }

                throw ex;
            }
            finally
            {

                //獨立呼叫Transcation,關閉連線
                if (Conn.State == ConnectionState.Connecting)
                {
                    Conn.Close();
                }


            }
        }