コード例 #1
0
        public ActionResult AddAccount(Account_Info account, int staff_id, string username, string password, string user_type)
        {
            account.username = username;
            account.user_type = user_type;
            account.password = password;
            account.active_flag = true;
            db.Account_Info.Add(account);
            db.SaveChanges();

            //updating the Staff_Info
            Staff_Info staff = db.Staff_Info.Find(staff_id);
            staff.account_info_id = account.account_info_id;
            db.Entry(staff).State = EntityState.Modified;
            db.SaveChanges();

            return RedirectToAction("Index","Account");
        }
コード例 #2
0
 //send the newly password set
 public ActionResult PasswordChange(Account_Info acc)
 {
     db.Entry(acc).State = EntityState.Modified;
     db.SaveChanges();
     return RedirectToAction("Index");
 }