public int UptMemberGrade(string intSize) { int flag = 0; string[] vs = intSize.Split(','); foreach (var item in vs) { switch (Convert.ToInt32(item) / 1000) { case 1: ForMemberGrade(1); break; case 2: ForMemberGrade(2); break; case 3: ForMemberGrade(3); break; case 4: ForMemberGrade(4); break; case 5: ForMemberGrade(5); break; case 6: ForMemberGrade(6); break; case 7: ForMemberGrade(7); break; case 8: ForMemberGrade(8); break; case 9: ForMemberGrade(9); break; case 10: ForMemberGrade(10); break; default: ForMemberGrade(11); break; } flag = context.SaveChanges(); } return(flag); }
public int AddAdmin() { AdminInfo admin = new AdminInfo { AdminFlag = 1, AdminName = "11", AdminPwd = "11" }; context.AdminInfo.Add(admin); return(context.SaveChanges()); }