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

            if (rowsCount > 0)
            {
                university.Model.CCOM.User_sms model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.User_sms();
                    if (dt.Rows[n]["User_sms_id"].ToString() != "")
                    {
                        model.User_sms_id = long.Parse(dt.Rows[n]["User_sms_id"].ToString());
                    }
                    if (dt.Rows[n]["User_id"].ToString() != "")
                    {
                        model.User_id = long.Parse(dt.Rows[n]["User_id"].ToString());
                    }
                    if (dt.Rows[n]["User_sms_left"].ToString() != "")
                    {
                        model.User_sms_left = int.Parse(dt.Rows[n]["User_sms_left"].ToString());
                    }
                    if (dt.Rows[n]["User_sms_create_time"].ToString() != "")
                    {
                        model.User_sms_create_time = DateTime.Parse(dt.Rows[n]["User_sms_create_time"].ToString());
                    }
                    if (dt.Rows[n]["User_sms_modify_time"].ToString() != "")
                    {
                        model.User_sms_modify_time = DateTime.Parse(dt.Rows[n]["User_sms_modify_time"].ToString());
                    }


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