示例#1
0
		//-----------------------------------------------------------------------
		public List<ImageTypes> Init(string LogFilePath, string LogFileName, SqlCommand cmd)
		{
			SqlConnection con = db.getConnection();
			cmd.Connection = con;
			con.Open();
			SqlDataReader dr = cmd.ExecuteReader();
			SmartDataReader rd = new SmartDataReader(dr);
			List<ImageTypes> l_ImageTypes = new List<ImageTypes>();
			try
			{
				while (rd.Read())
				{
					ImageTypes m_ImageTypes = new ImageTypes(db.ConnectionString);
					m_ImageTypes.ImageTypeId = rd.GetByte("ImageTypeId");
					m_ImageTypes.ImageTypeDesc = rd.GetString("ImageTypeDesc");
					m_ImageTypes.ImageTypeName = rd.GetString("ImageTypeName");
					l_ImageTypes.Add(m_ImageTypes);
				}
			}
			catch (SqlException ex)
			{
				LogFiles.WriteLog(ex.Message, LogFilePath + "\\Exception", LogFileName + "." + this.GetType().Name + "." + MethodBase.GetCurrentMethod().Name);
			}
			finally
			{
				rd.disposeReader(dr);
				cmd.Dispose();
				db.closeConnection(con);
			}
			return l_ImageTypes;
		}
示例#2
0
		//-----------------------------------------------------------------------
		public static List<ImageTypes> Static_GetList(string LogFilePath, string LogFileName, string constr)
		{
			List<ImageTypes> RetVal = new List<ImageTypes>();
			ImageTypes m_ImageTypes = new ImageTypes(constr);
			try
			{
				RetVal = m_ImageTypes.GetList(LogFilePath, LogFileName);
			}
			catch (Exception ex)
			{
				LogFiles.WriteLog(ex.Message, LogFilePath + "\\Exception", LogFileName + "." + m_ImageTypes.GetType().Name + "." + MethodBase.GetCurrentMethod().Name);
			}
			return RetVal;
		}
示例#3
0
		//-----------------------------------------------------------------------
		public ImageTypes Get(string LogFilePath, string LogFileName, string ImageTypeName)
		{
			ImageTypes RetVal = new ImageTypes(db.ConnectionString);
			try
			{
				List<ImageTypes> list = GetListByImageTypeName(LogFilePath, LogFileName, ImageTypeName);
				if (list.Count > 0)
				{
					RetVal = (ImageTypes)list[0];
				}
			}
			catch (Exception ex)
			{
				LogFiles.WriteLog(ex.Message, LogFilePath + "\\Exception", LogFileName + "." + this.GetType().Name + "." + MethodBase.GetCurrentMethod().Name);
			}
			return RetVal;
		}
示例#4
0
		//-----------------------------------------------------------------------
		public static byte Static_GetIdByImageTypeName(string LogFilePath, string LogFileName, string constr, string ImageTypeName)
		{
			byte RetVal = 0;
			ImageTypes m_ImageTypes = new ImageTypes(constr);
			try
			{
				m_ImageTypes = m_ImageTypes.Get(LogFilePath, LogFileName, ImageTypeName);
				if (m_ImageTypes.ImageTypeId > 0)
				{
					RetVal = m_ImageTypes.ImageTypeId;
				}
			}
			catch (Exception ex)
			{
				LogFiles.WriteLog(ex.Message, LogFilePath + "\\Exception", LogFileName + "." + m_ImageTypes.GetType().Name + "." + MethodBase.GetCurrentMethod().Name);
			}
			return RetVal;
		}