C#--应用结构体变量

1、定义:
/// <summary>
        
/// 定义ITP Head信息的结构体变量(siteID、productLineID、priceType、year、period)
        
/// </summary>

        public struct ITPHeadInfor
        
{
            
public int siteID;
            
public int productLineID;
            
public SystemEnum.PriceType priceType;
            
public int year;
            
public int period;
        }

2、应用
protected static List<CommonFunction.ITPHeadInfor> ms_ITPHeadIDs = new List<CommonFunction.ITPHeadInfor>();

public static List<CommonFunction.ITPHeadInfor> ITPHeadIDs
        
{
            
get
            
{
                
return ms_ITPHeadIDs;
            }

        }

CommonFunction.ITPHeadInfor headInfor = new CommonFunction.ITPHeadInfor();
                headInfor.year 
= year;
                headInfor.siteID 
= siteID;
                headInfor.productLineID 
= productLineID;
                headInfor.priceType 
= (SystemEnum.PriceType)priceType;
                headInfor.period 
= period;

                
//添加到List供到Oracle的使用
                if (!ms_ITPHeadIDs.Contains(headInfor))
                
{
                    ms_ITPHeadIDs.Add(headInfor);
                }

posted on 2007-07-03 15:48  Sammy  阅读(1601)  评论(0编辑  收藏  举报

导航