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

            if (rowsCount > 0)
            {
                LPWeb.Model.PointImportHistory model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.PointImportHistory();
                    if (dt.Rows[n]["HistoryId"].ToString() != "")
                    {
                        model.HistoryId = int.Parse(dt.Rows[n]["HistoryId"].ToString());
                    }
                    if (dt.Rows[n]["FileId"].ToString() != "")
                    {
                        model.FileId = int.Parse(dt.Rows[n]["FileId"].ToString());
                    }
                    if (dt.Rows[n]["ImportTime"].ToString() != "")
                    {
                        model.ImportTime = DateTime.Parse(dt.Rows[n]["ImportTime"].ToString());
                    }
                    if (dt.Rows[n]["Success"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Success"].ToString() == "1") || (dt.Rows[n]["Success"].ToString().ToLower() == "true"))
                        {
                            model.Success = true;
                        }
                        else
                        {
                            model.Success = false;
                        }
                    }
                    model.Error = dt.Rows[n]["Error"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.PointImportHistory model)
 {
     dal.Update(model);
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LPWeb.Model.PointImportHistory model)
 {
     return(dal.Add(model));
 }