コード例 #1
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<SmsServer.Model.SmsOprateLog> DataTableToList(DataTable dt)
 {
     List<SmsServer.Model.SmsOprateLog> modelList = new List<SmsServer.Model.SmsOprateLog>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         SmsServer.Model.SmsOprateLog model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new SmsServer.Model.SmsOprateLog();
             //model.ID=dt.Rows[n]["ID"].ToString();
             model.OpraterType=dt.Rows[n]["OpraterType"].ToString();
             model.OpraterID=dt.Rows[n]["OpraterID"].ToString();
             model.OprationInfo=dt.Rows[n]["OprationInfo"].ToString();
             if(dt.Rows[n]["OprateTime"].ToString()!="")
             {
                 model.OprateTime=DateTime.Parse(dt.Rows[n]["OprateTime"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
コード例 #2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <SmsServer.Model.SmsOprateLog> DataTableToList(DataTable dt)
        {
            List <SmsServer.Model.SmsOprateLog> modelList = new List <SmsServer.Model.SmsOprateLog>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                SmsServer.Model.SmsOprateLog model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new SmsServer.Model.SmsOprateLog();
                    //model.ID=dt.Rows[n]["ID"].ToString();
                    model.OpraterType  = dt.Rows[n]["OpraterType"].ToString();
                    model.OpraterID    = dt.Rows[n]["OpraterID"].ToString();
                    model.OprationInfo = dt.Rows[n]["OprationInfo"].ToString();
                    if (dt.Rows[n]["OprateTime"].ToString() != "")
                    {
                        model.OprateTime = DateTime.Parse(dt.Rows[n]["OprateTime"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(SmsServer.Model.SmsOprateLog model)
 {
     dal.Update(model);
 }
コード例 #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(SmsServer.Model.SmsOprateLog model)
 {
     return(dal.Add(model));
 }