Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Hownet.Model.KQ_UserLogList> DataTableToList(DataTable dt)
        {
            List <Hownet.Model.KQ_UserLogList> modelList = new List <Hownet.Model.KQ_UserLogList>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Hownet.Model.KQ_UserLogList model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.KQ_UserLogList();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["UserID"] != null && dt.Rows[n]["UserID"].ToString() != "")
                    {
                        model.UserID = int.Parse(dt.Rows[n]["UserID"].ToString());
                    }
                    if (dt.Rows[n]["Nian"] != null && dt.Rows[n]["Nian"].ToString() != "")
                    {
                        model.Nian = int.Parse(dt.Rows[n]["Nian"].ToString());
                    }
                    if (dt.Rows[n]["Yue"] != null && dt.Rows[n]["Yue"].ToString() != "")
                    {
                        model.Yue = int.Parse(dt.Rows[n]["Yue"].ToString());
                    }
                    if (dt.Rows[n]["Ri"] != null && dt.Rows[n]["Ri"].ToString() != "")
                    {
                        model.Ri = int.Parse(dt.Rows[n]["Ri"].ToString());
                    }
                    if (dt.Rows[n]["Shi"] != null && dt.Rows[n]["Shi"].ToString() != "")
                    {
                        model.Shi = int.Parse(dt.Rows[n]["Shi"].ToString());
                    }
                    if (dt.Rows[n]["Fen"] != null && dt.Rows[n]["Fen"].ToString() != "")
                    {
                        model.Fen = int.Parse(dt.Rows[n]["Fen"].ToString());
                    }
                    if (dt.Rows[n]["Miao"] != null && dt.Rows[n]["Miao"].ToString() != "")
                    {
                        model.Miao = int.Parse(dt.Rows[n]["Miao"].ToString());
                    }
                    model.CompanySN = dt.Rows[n]["CompanySN"].ToString();
                    if (dt.Rows[n]["OldID"] != null && dt.Rows[n]["OldID"].ToString() != "")
                    {
                        model.OldID = int.Parse(dt.Rows[n]["OldID"].ToString());
                    }
                    model.DateOne = dt.Rows[n]["DateOne"].ToString();
                    model.TimeOne = dt.Rows[n]["TimeOne"].ToString();
                    if (dt.Rows[n]["DateTime"] != null && dt.Rows[n]["DateTime"].ToString() != "")
                    {
                        model.DateTime = DateTime.Parse(dt.Rows[n]["DateTime"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hownet.Model.KQ_UserLogList model)
 {
     return(dal.Update(model));
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Hownet.Model.KQ_UserLogList model)
 {
     return(dal.Add(model));
 }