public static void ReleaseInstance() { string Function_Name = "ReleaseInstance"; LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Entered"); if (m_instance != null) { m_instance = null; } LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Exited"); }
public static DatalogDPTrendDAO GetInstance() { string Function_Name = "GetInstance"; LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Entered"); if (m_instance == null) { LogHelper.Debug(CLASS_NAME, Function_Name, "Creating static DatalogDPTrendDAO instance!"); m_instance = new DatalogDPTrendDAO(); } LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Exited"); return(m_instance); }
/// <summary> /// Delete opc Sample Group by key /// </summary> /// <param name="opcGrpId">Sample group key</param> public bool DeleteOPCSampleGroupById(string opcGrpId) { string Function_Name = "DeleteOPCSampleGroupById"; LogHelper.Trace(CLASS_NAME, Function_Name, string.Format("Function_Entered with params - SampleGroup ID = {0}", opcGrpId)); bool result = true; SimpleDatabase.GetInstance().BeginTransaction(); try { List <string> sqlStrings = new List <string>(); for (int i = 0; i < 2; i++) { string sql = "DELETE FROM DATALOG_DP_GROUP_TREND WHERE PKEY = " + opcGrpId; sqlStrings.Add(sql); } List <SqlParameter> parameters = DAOHelper.CreateEnqueneParameters(sqlStrings); result = SimpleDatabase.GetInstance().ExecuteEnqueneProcedure(parameters); } catch (Exception localException) { LogHelper.Error(CLASS_NAME, Function_Name, localException.ToString()); } if (result) { //update datapoint table also. result = DatalogDPTrendDAO.GetInstance().DisableGrpDataPoint(Convert.ToDouble(opcGrpId)); } if (result) { result = DatalogConfigSettingsDAO.GetInstance().UpdateTrendVersionNum(); } if (!result) { SimpleDatabase.GetInstance().RollbackTransaction(); } else { SimpleDatabase.GetInstance().CommitTransaction(); } LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Exited"); return(result); }