Пример #1
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<ZQUSR.Model.sr_TotalScore> DataTableToList(DataTable dt)
 {
     List<ZQUSR.Model.sr_TotalScore> modelList = new List<ZQUSR.Model.sr_TotalScore>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         ZQUSR.Model.sr_TotalScore model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new ZQUSR.Model.sr_TotalScore();
             if(dt.Rows[n]["PK_TID"].ToString()!="")
             {
                 model.PK_TID=int.Parse(dt.Rows[n]["PK_TID"].ToString());
             }
             model.FK_UserID=dt.Rows[n]["FK_UserID"].ToString();
             model.Year=dt.Rows[n]["Year"].ToString();
             if(dt.Rows[n]["TotalScore"].ToString()!="")
             {
                 model.TotalScore=decimal.Parse(dt.Rows[n]["TotalScore"].ToString());
             }
             if(dt.Rows[n]["TotalRewards"].ToString()!="")
             {
                 model.TotalRewards=decimal.Parse(dt.Rows[n]["TotalRewards"].ToString());
             }
             model.Extra1=dt.Rows[n]["Extra1"].ToString();
             model.Extra2=dt.Rows[n]["Extra2"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }
Пример #2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <ZQUSR.Model.sr_TotalScore> DataTableToList(DataTable dt)
        {
            List <ZQUSR.Model.sr_TotalScore> modelList = new List <ZQUSR.Model.sr_TotalScore>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                ZQUSR.Model.sr_TotalScore model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ZQUSR.Model.sr_TotalScore();
                    if (dt.Rows[n]["PK_TID"].ToString() != "")
                    {
                        model.PK_TID = int.Parse(dt.Rows[n]["PK_TID"].ToString());
                    }
                    model.FK_UserID = dt.Rows[n]["FK_UserID"].ToString();
                    model.Year      = dt.Rows[n]["Year"].ToString();
                    if (dt.Rows[n]["TotalScore"].ToString() != "")
                    {
                        model.TotalScore = decimal.Parse(dt.Rows[n]["TotalScore"].ToString());
                    }
                    if (dt.Rows[n]["TotalRewards"].ToString() != "")
                    {
                        model.TotalRewards = decimal.Parse(dt.Rows[n]["TotalRewards"].ToString());
                    }
                    model.Extra1 = dt.Rows[n]["Extra1"].ToString();
                    model.Extra2 = dt.Rows[n]["Extra2"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ZQUSR.Model.sr_TotalScore model)
 {
     dal.Update(model);
 }
Пример #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(ZQUSR.Model.sr_TotalScore model)
 {
     return(dal.Add(model));
 }