//------------------------------------------------------------------------------------------------------------------- private List <EditorStatus> Init(string LogFilePath, string LogFileName, SqlCommand cmd) { SqlConnection con = db.getConnection(); cmd.Connection = con; List <EditorStatus> l_EditorStatus = new List <EditorStatus>(); try { con.Open(); SqlDataReader reader = cmd.ExecuteReader(); SmartDataReader smartReader = new SmartDataReader(reader); while (smartReader.Read()) { EditorStatus m_EditorStatus = new EditorStatus(db.ConnectionString); m_EditorStatus.EditorStatusId = smartReader.GetByte("EditorStatusId"); m_EditorStatus.EditorStatusName = smartReader.GetString("EditorStatusName"); m_EditorStatus.EditorStatusDesc = smartReader.GetString("EditorStatusDesc"); l_EditorStatus.Add(m_EditorStatus); } smartReader.disposeReader(reader); db.closeConnection(con); } catch (SqlException ex) { LogFiles.WriteLog(ex.Message, LogFilePath + "\\Exception", LogFileName + "." + this.GetType().Name + "." + MethodBase.GetCurrentMethod().Name); } return(l_EditorStatus); }
//-------------------------------------------------------------------------------------------------------------------- public EditorStatus Get(string LogFilePath, string LogFileName, byte EditorStatusId) { EditorStatus RetVal = new EditorStatus(db.ConnectionString); try { List <EditorStatus> list = GetListByEditorStatusId(LogFilePath, LogFileName, EditorStatusId); if (list.Count > 0) { RetVal = (EditorStatus)list[0]; } } catch (Exception ex) { LogFiles.WriteLog(ex.Message, LogFilePath + "\\Exception", LogFileName + "." + this.GetType().Name + "." + MethodBase.GetCurrentMethod().Name); } return(RetVal); }