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

            if (rowsCount > 0)
            {
                university.Model.CCOM.SMS_apply_record model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.SMS_apply_record();
                    if (dt.Rows[n]["SMS_apply_id"].ToString() != "")
                    {
                        model.SMS_apply_id = long.Parse(dt.Rows[n]["SMS_apply_id"].ToString());
                    }
                    if (dt.Rows[n]["SMS_apply_number"].ToString() != "")
                    {
                        model.SMS_apply_number = int.Parse(dt.Rows[n]["SMS_apply_number"].ToString());
                    }
                    if (dt.Rows[n]["SMS_apply_status"].ToString() != "")
                    {
                        model.SMS_apply_status = int.Parse(dt.Rows[n]["SMS_apply_status"].ToString());
                    }
                    model.SMS_apply_reason = dt.Rows[n]["SMS_apply_reason"].ToString();
                    if (dt.Rows[n]["SMS_apply_type"].ToString() != "")
                    {
                        model.SMS_apply_type = int.Parse(dt.Rows[n]["SMS_apply_type"].ToString());
                    }
                    if (dt.Rows[n]["User_id"].ToString() != "")
                    {
                        model.User_id = long.Parse(dt.Rows[n]["User_id"].ToString());
                    }
                    if (dt.Rows[n]["SMS_give_number"].ToString() != "")
                    {
                        model.SMS_give_number = int.Parse(dt.Rows[n]["SMS_give_number"].ToString());
                    }
                    if (dt.Rows[n]["SMS_apply_time"].ToString() != "")
                    {
                        model.SMS_apply_time = DateTime.Parse(dt.Rows[n]["SMS_apply_time"].ToString());
                    }
                    model.SMS_check_reason = dt.Rows[n]["SMS_check_reason"].ToString();


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