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

            if (rowsCount > 0)
            {
                StudentMS.Model.S_User model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model           = new StudentMS.Model.S_User();
                    model.UserID    = dt.Rows[n]["UserID"].ToString();
                    model.UPassWord = dt.Rows[n]["UPassWord"].ToString();
                    model.SNO       = dt.Rows[n]["SNO"].ToString();
                    model.TNO       = dt.Rows[n]["TNO"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(StudentMS.Model.S_User model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(StudentMS.Model.S_User model)
 {
     dal.Add(model);
 }