public string[] CreateStoreDiff(ArrayList masterParameter, ArrayList parameterList) { Conn = USEDB.CreateConnection(); Conn.Open(); DbTransaction transaction = Conn.BeginTransaction(); CAM03DBO dbo = new CAM03DBO(ref USEDB); try { string[] strReturn = dbo.CreateStoreDiff(transaction, masterParameter); if (strReturn[2] != "") { transaction.Rollback(); return strReturn; } if (parameterList.Count > 0) { for (int i = 0; i < parameterList.Count; i++) { ((ArrayList)parameterList[i]).Insert(0, int.Parse(strReturn[0])); UpdateDiff(transaction, (ArrayList)parameterList[i]); } } dbo.PatchProc(transaction, strReturn[1], masterParameter[18].ToString(), masterParameter[23].ToString()); if (Convert.ToInt16(masterParameter[6]) == 1) { dbo.Cal_Sch_AccountMonth(transaction, strReturn[1]); } transaction.Commit(); return strReturn; } catch { transaction.Rollback(); throw; } finally { Conn.Close(); } }
public void DoPatchProc(DbTransaction transaction, string strID, string strUID, string strUPLOAD) { bool IsRootTranscation = false; CAM03DBO dbo = new CAM03DBO(ref USEDB); IsRootTranscation = (transaction == null) ? true : false; if (IsRootTranscation) { Conn = USEDB.CreateConnection(); Conn.Open(); DBT = Conn.BeginTransaction(); } else { DBT = transaction; } try { dbo.PatchProc(transaction, strID, strUID, strUPLOAD); if (IsRootTranscation) { DBT.Commit(); } } catch { if (IsRootTranscation) { DBT.Rollback(); } throw; } finally { if (IsRootTranscation) { if (Conn.State == ConnectionState.Connecting) { Conn.Close(); } } } }