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

            if (rowsCount > 0)
            {
                ZQUSR.Model.sr_Roles model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model           = new ZQUSR.Model.sr_Roles();
                    model.PK_RoleID = dt.Rows[n]["PK_RoleID"].ToString();
                    model.RoleName  = dt.Rows[n]["RoleName"].ToString();
                    model.RoleIntro = dt.Rows[n]["RoleIntro"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ZQUSR.Model.sr_Roles model)
 {
     dal.Update(model);
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(ZQUSR.Model.sr_Roles model)
 {
     dal.Add(model);
 }