Exemple #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DigiPower.Onlinecol.Standard.Model.T_Train_Rec_MDL> DataTableToList(DataTable dt)
        {
            List <DigiPower.Onlinecol.Standard.Model.T_Train_Rec_MDL> modelList = new List <DigiPower.Onlinecol.Standard.Model.T_Train_Rec_MDL>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DigiPower.Onlinecol.Standard.Model.T_Train_Rec_MDL model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DigiPower.Onlinecol.Standard.Model.T_Train_Rec_MDL();
                    if (dt.Rows[n]["TrainRecID"].ToString() != "")
                    {
                        model.TrainRecID = int.Parse(dt.Rows[n]["TrainRecID"].ToString());
                    }
                    if (dt.Rows[n]["UserID"].ToString() != "")
                    {
                        model.UserID = int.Parse(dt.Rows[n]["UserID"].ToString());
                    }
                    if (dt.Rows[n]["TrainPlanID"].ToString() != "")
                    {
                        model.TrainPlanID = int.Parse(dt.Rows[n]["TrainPlanID"].ToString());
                    }
                    model.TrainDesc   = dt.Rows[n]["TrainDesc"].ToString();
                    model.TrainResult = dt.Rows[n]["TrainResult"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(DigiPower.Onlinecol.Standard.Model.T_Train_Rec_MDL model)
 {
     dal.Update(model);
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(DigiPower.Onlinecol.Standard.Model.T_Train_Rec_MDL model)
 {
     return(dal.Add(model));
 }