Esempio n. 1
0
 public static void replaceMember(Member target, Member source)
 {
     target.MemberId = source.MemberId;
     target.MemberName = source.MemberName;
     target.NickName = source.NickName;
     target.Phone = source.Phone;
     target.Salary = source.Salary;
 }
Esempio n. 2
0
 public ActionResult CheckNickname(Member member)
 {
     if (member.NickName.Contains("a"))
     {
         return Json(string.Format("{0} is reserved, enter another nickname", member.NickName), JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(true, JsonRequestBehavior.AllowGet);
     }
 }
Esempio n. 3
0
 public ActionResult CheckSalary(Member member)
 {
     if (member.Salary < 10000)
     {
         return Json(string.Format("{0} Is really too little", member.Salary), JsonRequestBehavior.AllowGet);
     }
     if (member.Salary > 1000000)
     {
         return Json("You are exagerating. Nobody should learn more than 1 million", JsonRequestBehavior.AllowGet);
     }
     return Json(true, JsonRequestBehavior.AllowGet);
 }
Esempio n. 4
0
 public ActionResult Create(Member member)
 {
     MemberRepository.Members.Add(member);
     return RedirectToAction("Index");
 }