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

            if (rowsCount > 0)
            {
                university.Model.CCOM.User_permission model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.User_permission();
                    if (dt.Rows[n]["Upe_id"].ToString() != "")
                    {
                        model.Upe_id = long.Parse(dt.Rows[n]["Upe_id"].ToString());
                    }
                    if (dt.Rows[n]["User_id"].ToString() != "")
                    {
                        model.User_id = long.Parse(dt.Rows[n]["User_id"].ToString());
                    }
                    if (dt.Rows[n]["Sf_id"].ToString() != "")
                    {
                        model.Sf_id = int.Parse(dt.Rows[n]["Sf_id"].ToString());
                    }


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