public ActionResult Edit([Bind(Include = "UserId,UserName,Password,IsActive")] UserProfile userProfile) { if (ModelState.IsValid) { db.Entry(userProfile).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(userProfile)); }
public ActionResult Approve(int id) { int ID = id; tblSkill idea = entity.tblSkills.FirstOrDefault(g => g.skId == id); idea.skStatus = "Approved"; entity.Entry(idea).State = System.Data.Entity.EntityState.Modified; entity.SaveChanges(); return(RedirectToAction("ConfirmEmail", new { id = ID })); }
public ActionResult Edit([Bind(Include = "idColaborador,Nome,Email,CPF,Senha,Oficio,DataNascimento,Sexo,Telefone,Disponibilidade")] Colaborador colaborador) { if (ModelState.IsValid) { db.Entry(colaborador).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(colaborador)); }
public ActionResult Edit([Bind(Include = "usuarioId,Nombre,CorreoElectronico,nombreus,pass")] Usuario usuario) { if (ModelState.IsValid) { db.Entry(usuario).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(usuario)); }
public ActionResult Edit([Bind(Include = "UserID,Username,Password")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "skId,skName,skExperience,skPrevProjects,skCurrentProject,skDomain,skUsername")] tblSkill tblSkill) { if (ModelState.IsValid) { db.Entry(tblSkill).State = EntityState.Modified; db.SaveChanges(); string un = loggedinUser; return(RedirectToAction("Dashboard_Employee", new { uname = loggedinUser })); } return(View(tblSkill)); }
public ActionResult Transfer([Bind(Include = "AccountNumber,TransferFrom,TransferTo,TransferAmount,TransferDate,CurrentBalance,Funds,CustomerName")] TransactionDetail transactionDetail) { if (Session["UserName"] != null && Session["UserRole"].ToString().Contains("Customer")) { if (ModelState.IsValid) { transactionDetail.TransferDate = DateTime.Now; transactionDetail.AccountNumber = Convert.ToInt32(Session["AccountNumber"]); transactionDetail.TransferFrom = Convert.ToInt32(Session["AccountNumber"]); transactionDetail.CustomerName = Convert.ToString(Session["CustomerName"]); db2.TransactionDetails.Add(transactionDetail); db2.SaveChanges(); //Receivers Balance Increases BanksCustomer banksCustomer = new BanksCustomer(); banksCustomer = db2.BanksCustomers.Where(u => u.AccountNumber == transactionDetail.TransferTo).FirstOrDefault(); LoginDetails updateBalanceReveiver = db.LoginDetails.Where(u => u.AccountNumber1 == transactionDetail.TransferTo).FirstOrDefault(); updateBalanceReveiver.CurrentBalance += transactionDetail.TransferAmount; db.Entry(updateBalanceReveiver).Property("CurrentBalance").IsModified = true; db.SaveChanges(); //Senders Balance Decreases banksCustomer = db2.BanksCustomers.Where(u => u.AccountNumber == transactionDetail.TransferFrom).FirstOrDefault(); LoginDetails updateBalanceSender = db.LoginDetails.Where(u => u.AccountNumber1 == transactionDetail.TransferFrom).FirstOrDefault(); updateBalanceSender.CurrentBalance -= transactionDetail.TransferAmount; db.Entry(updateBalanceSender).Property("CurrentBalance").IsModified = true; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ReceiversAccountNumber = new SelectList(db2.BanksCustomers.Where(u => u.UserRole.ToString().Contains("Customer")), "AccountNumber", "AccountNumber", transactionDetail.AccountNumber); return(View(transactionDetail)); } Response.Write("<script>alert('Session logged out. Sign in again');</script>"); FormsAuthentication.SignOut(); Session.Clear(); return(RedirectToAction("SignIn", "Auth")); }
public ActionResult AddFund(Fund fund) { if (ModelState.IsValid) { //Customers Fund Increases into BanksCustomer Table BanksCustomer banksCustomer = db.BanksCustomers.Where(u => u.AccountNumber == fund.AccountNumber).FirstOrDefault(); LoginDetails updateFund = db2.LoginDetails.Where(u => u.AccountNumber1 == fund.AccountNumber).FirstOrDefault(); updateFund.Fund = banksCustomer.Fund + fund.Fund1; db2.Entry(updateFund).Property("Fund").IsModified = true; db2.SaveChanges(); //Save Funds History into Fund Table db.Funds.Add(fund); db.SaveChanges(); return(RedirectToAction("Index")); } return(View()); }