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

            if (rowsCount > 0)
            {
                SmsServer.Model.SmsLoginLog model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new SmsServer.Model.SmsLoginLog();
                    //model.ID=dt.Rows[n]["ID"].ToString();
                    if (dt.Rows[n]["LoginTime"].ToString() != "")
                    {
                        model.LoginTime = DateTime.Parse(dt.Rows[n]["LoginTime"].ToString());
                    }
                    model.LoginIp     = dt.Rows[n]["LoginIp"].ToString();
                    model.LoginUser   = dt.Rows[n]["LoginUser"].ToString();
                    model.LoginPwd    = dt.Rows[n]["LoginPwd"].ToString();
                    model.LoginResult = dt.Rows[n]["LoginResult"].ToString();
                    if (dt.Rows[n]["LoginType"].ToString() != "")
                    {
                        model.LoginType = int.Parse(dt.Rows[n]["LoginType"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<SmsServer.Model.SmsLoginLog> DataTableToList(DataTable dt)
 {
     List<SmsServer.Model.SmsLoginLog> modelList = new List<SmsServer.Model.SmsLoginLog>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         SmsServer.Model.SmsLoginLog model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new SmsServer.Model.SmsLoginLog();
             //model.ID=dt.Rows[n]["ID"].ToString();
             if(dt.Rows[n]["LoginTime"].ToString()!="")
             {
                 model.LoginTime=DateTime.Parse(dt.Rows[n]["LoginTime"].ToString());
             }
             model.LoginIp=dt.Rows[n]["LoginIp"].ToString();
             model.LoginUser=dt.Rows[n]["LoginUser"].ToString();
             model.LoginPwd=dt.Rows[n]["LoginPwd"].ToString();
             model.LoginResult=dt.Rows[n]["LoginResult"].ToString();
             if(dt.Rows[n]["LoginType"].ToString()!="")
             {
                 model.LoginType=int.Parse(dt.Rows[n]["LoginType"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
Пример #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(SmsServer.Model.SmsLoginLog model)
 {
     dal.Update(model);
 }
Пример #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(SmsServer.Model.SmsLoginLog model)
 {
     return(dal.Add(model));
 }