Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "relayConnectionID,relayID,relayID2,relayWeight")] RelayToRelayConnection relayToRelayConnection)
 {
     if (ModelState.IsValid)
     {
         db.Entry(relayToRelayConnection).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(relayToRelayConnection));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "regionID,regionName,gatewayIP")] Regions regions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(regions).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(regions));
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "SecurityQuestionsID,AspNetUserID,QuestionID,Answer")] SecurityQuestion securityQuestion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(securityQuestion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(securityQuestion));
 }
Exemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "relayID,relayName,relayIP,regionID,isGateway,relayQueue,isActive")] Relay relay)
 {
     if (ModelState.IsValid)
     {
         db.Entry(relay).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.regionID = new SelectList(db.Regions, "regionID", "regionName", relay.regionID);
     return(View(relay));
 }
Exemplo n.º 5
0
 public ActionResult Edit([Bind(Include = "storeID,storeIP,storeName,storeWeight,relayID,regionID")] Store store)
 {
     if (ModelState.IsValid)
     {
         db.Entry(store).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.regionID = new SelectList(db.Regions, "regionID", "regionName", store.regionID);
     ViewBag.relayID  = new SelectList(db.Relays, "relayID", "relayName", store.relayID);
     return(View(store));
 }
Exemplo n.º 6
0
        public ActionResult Edit([Bind(Include = "relayID,relayName")] Relay relay)
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Index", "Home"));
            }

            if (ModelState.IsValid)
            {
                db.Entry(relay).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(relay));
        }
Exemplo n.º 7
0
 public ActionResult Edit([Bind(Include = "cardID,cardNumber,cardExpirationDate,cardSecurityCode,accountID,firstName,lastName")] CreditCard creditCard, DateTime cardExpirationDate)
 {
     //creditCard.cardNumber = getCardNumber(g_cardID);
     creditCard.cardID             = g_cardID;
     creditCard.cardNumber         = g_cardNumber;
     creditCard.cardExpirationDate = cardExpirationDate;
     ViewBag.cardExpirationDate    = creditCard.cardExpirationDate;
     //if (ModelState.IsValid)
     //{
     ////Change the accountNumber again to match the accountID:
     //changeCardNumberToPreviousCardNumber(cardID, cardNumber);
     db.Entry(creditCard).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
     //}
     //ViewBag.accountID = new SelectList(db.Accounts, "accountID", "accountNumber", creditCard.accountID);
     //return View(creditCard);
 }
Exemplo n.º 8
0
 public ActionResult Edit([Bind(Include = "transactionID,transactionTime,transactionAmount,transactionType,transactionMerchant,transactionStatus,encryptedFlag,cardID,storeID")] Transaction transaction)
 {
     if (ModelState.IsValid)
     {
         if (transaction.transactionType == "Debit")
         {
             transaction.transactionMerchant = "Self";
         }
         else
         {
             //transaction.transactionMerchant = (from store in db.Stores where store.storeID == transaction.storeID select store.storeName).FirstOrDefault();
         }
         db.Entry(transaction).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     //ViewBag.cardID = new SelectList(db.CreditCards, "cardID", "cardNumber", transaction.cardID);
     //ViewBag.storeID = new SelectList(db.Stores, "storeID", "storeIp", transaction.storeID);
     return(View(transaction));
 }
Exemplo n.º 9
0
 public ActionResult Edit([Bind(Include = "accountID,accountNumber,accountBalance,accountName,accountFirstName,accountLastName,accountAddress,accountCity,accountState,accountZip,accountPhone,accountMax")] Account account)
 {
     if (ModelState.IsValid)
     {
         db.Entry(account).State = EntityState.Modified;
         if (account.accountBalance > 9999999999999999 || account.accountBalance < -9999999999999999)
         {
             ModelState.AddModelError("accountBalance", "The balance must between -9999999999999999 and 9999999999999999");
             return View(account);
         }
         else
         {
             db.SaveChanges();
             //Change the accountNumber again to match the accountID:
             changeAccountNumberToAccountID(editId);
             return RedirectToAction("Index");
         }
     }
     return View(account);
 }