예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <university.Model.CCOM.SMS> DataTableToList(DataTable dt)
        {
            List <university.Model.CCOM.SMS> modelList = new List <university.Model.CCOM.SMS>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                university.Model.CCOM.SMS model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.SMS();
                    if (dt.Rows[n]["SMS_id"].ToString() != "")
                    {
                        model.SMS_id = long.Parse(dt.Rows[n]["SMS_id"].ToString());
                    }
                    if (dt.Rows[n]["Notice_id"].ToString() != "")
                    {
                        model.Notice_id = long.Parse(dt.Rows[n]["Notice_id"].ToString());
                    }
                    if (dt.Rows[n]["SMS_sender_id"].ToString() != "")
                    {
                        model.SMS_sender_id = long.Parse(dt.Rows[n]["SMS_sender_id"].ToString());
                    }
                    model.SMS_receiver_id = dt.Rows[n]["SMS_receiver_id"].ToString();
                    model.SMS_content     = dt.Rows[n]["SMS_content"].ToString();
                    if (dt.Rows[n]["SMS_date"].ToString() != "")
                    {
                        model.SMS_date = DateTime.Parse(dt.Rows[n]["SMS_date"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(university.Model.CCOM.SMS model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public long  Add(university.Model.CCOM.SMS model)
 {
     return(dal.Add(model));
 }