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

            if (rowsCount > 0)
            {
                lgk.Model.AppLog model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new lgk.Model.AppLog();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = long.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["AddTime"].ToString() != "")
                    {
                        model.AddTime = DateTime.Parse(dt.Rows[n]["AddTime"].ToString());
                    }
                    if (dt.Rows[n]["OpType"].ToString() != "")
                    {
                        model.OpType = int.Parse(dt.Rows[n]["OpType"].ToString());
                    }
                    model.Msg = dt.Rows[n]["Msg"].ToString();
                    if (dt.Rows[n]["UserID"].ToString() != "")
                    {
                        model.UserID = long.Parse(dt.Rows[n]["UserID"].ToString());
                    }
                    model.UserCode     = dt.Rows[n]["UserCode"].ToString();
                    model.UserName     = dt.Rows[n]["UserName"].ToString();
                    model.Longitude    = dt.Rows[n]["Longitude"].ToString();
                    model.MAC          = dt.Rows[n]["MAC"].ToString();
                    model.PhoneVersion = dt.Rows[n]["PhoneVersion"].ToString();
                    model.PhoneBrand   = dt.Rows[n]["PhoneBrand"].ToString();
                    model.PhoneSystem  = dt.Rows[n]["PhoneSystem"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(lgk.Model.AppLog model)
 {
     return(dal.Update(model));
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public long Add(lgk.Model.AppLog model)
 {
     return(dal.Add(model));
 }