예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <NoName.NetShop.Model.LoginLogModel> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List <NoName.NetShop.Model.LoginLogModel> modelList = new List <NoName.NetShop.Model.LoginLogModel>();
            int rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > 0)
            {
                NoName.NetShop.Model.LoginLogModel model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new NoName.NetShop.Model.LoginLogModel();
                    if (ds.Tables[0].Rows[n]["UserId"].ToString() != "")
                    {
                        model.UserId = int.Parse(ds.Tables[0].Rows[n]["UserId"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["LoginTime"].ToString() != "")
                    {
                        model.LoginTime = DateTime.Parse(ds.Tables[0].Rows[n]["LoginTime"].ToString());
                    }
                    model.IP = ds.Tables[0].Rows[n]["IP"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<NoName.NetShop.Model.LoginLogModel> GetModelList(string strWhere)
 {
     DataSet ds = dal.GetList(strWhere);
     List<NoName.NetShop.Model.LoginLogModel> modelList = new List<NoName.NetShop.Model.LoginLogModel>();
     int rowsCount = ds.Tables[0].Rows.Count;
     if (rowsCount > 0)
     {
         NoName.NetShop.Model.LoginLogModel model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new NoName.NetShop.Model.LoginLogModel();
             if(ds.Tables[0].Rows[n]["UserId"].ToString()!="")
             {
                 model.UserId=int.Parse(ds.Tables[0].Rows[n]["UserId"].ToString());
             }
             if(ds.Tables[0].Rows[n]["LoginTime"].ToString()!="")
             {
                 model.LoginTime=DateTime.Parse(ds.Tables[0].Rows[n]["LoginTime"].ToString());
             }
             model.IP=ds.Tables[0].Rows[n]["IP"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }
예제 #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(NoName.NetShop.Model.LoginLogModel model)
 {
     dal.Update(model);
 }
예제 #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(NoName.NetShop.Model.LoginLogModel model)
 {
     dal.Add(model);
 }