コード例 #1
0
ファイル: S_U_R.cs プロジェクト: gxmandppx/StudentMS
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <StudentMS.Model.S_U_R> DataTableToList(DataTable dt)
        {
            List <StudentMS.Model.S_U_R> modelList = new List <StudentMS.Model.S_U_R>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                StudentMS.Model.S_U_R model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model        = new StudentMS.Model.S_U_R();
                    model.UserID = dt.Rows[n]["UserID"].ToString();
                    model.RoleID = dt.Rows[n]["RoleID"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
ファイル: S_U_R.cs プロジェクト: gxmandppx/StudentMS
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(StudentMS.Model.S_U_R model)
 {
     return(dal.Update(model));
 }
コード例 #3
0
ファイル: S_U_R.cs プロジェクト: gxmandppx/StudentMS
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(StudentMS.Model.S_U_R model)
 {
     dal.Add(model);
 }