日期:2014-05-20 浏览次数:20880 次
int result = 0;
using (var db = new SchoolSubSystemDBContext())
{
var ur = db.PermissionRoles.FirstOrDefault(r => r.ID == user.UserRole.ID);
user.UserRole = ur;
db.Entry(user).State = EntityState.Modified;
result = db.SaveChanges();
}
return result > 0;
[Required(ErrorMessage = "请选择用户角色")]
public System_Permission_UserRoles UserRole { get; set; }