public ActionResult Edit(Staticpage staticpage)
 {
     if (ModelState.IsValid)
     {
         db.Entry(staticpage).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(staticpage));
 }
Example #2
0
 public ActionResult Edit([Bind(Include = "ID,LocationName,Address,City,Latitude,Longitude,BusinessUnitName,CurrencyCode,InsertDate,UpdateDate,DeleteDate,IsDeleted")] Location location)
 {
     if (ModelState.IsValid)
     {
         location.UpdateDate      = DateTime.UtcNow;
         db.Entry(location).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(location));
 }
Example #3
0
 public ActionResult Edit([Bind(Include = "Id,LocationID,Availability,InsertDate,UpdateDate,DeleteDate,IsDeleted,ChargerName")] Charger charger)
 {
     if (ModelState.IsValid)
     {
         charger.UpdateDate      = DateTime.UtcNow;
         db.Entry(charger).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LocationID = new SelectList(db.Locations, "ID", "LocationName", charger.LocationID);
     return(View(charger));
 }
Example #4
0
        public ActionResult Edit([Bind(Include = "ServiceID,ServiceName,ServiceDescription,Accepted,InsertDate,UpdateDate,DeleteDate,isDeleted,ServiceStatus")] Service service)
        {
            if (ModelState.IsValid)
            {
                service.UpdateDate      = DateTime.UtcNow;
                db.Entry(service).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(service));
        }
 public ActionResult Edit([Bind(Include = "Id,ChargerId,LocationId,ConnectorTypeId,ConnectorStatus,SMSCode,ConnectorUnId,Tariff,InsertDate,UpdateDate,DeleteDate,isDeleted")] Connector connector)
 {
     if (ModelState.IsValid)
     {
         connector.UpdateDate      = DateTime.UtcNow;
         db.Entry(connector).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ChargerId       = new SelectList(db.Chargers, "Id", "ChargerName", connector.ChargerId);
     ViewBag.ConnectorTypeId = new SelectList(db.Connector_Types, "Id", "ConnectorName", connector.ConnectorTypeId);
     ViewBag.LocationId      = new SelectList(db.Locations, "ID", "LocationName", connector.LocationId);
     return(View(connector));
 }
        public ActionResult Edit([Bind(Include = "ID,FirstName,LastName,BusinessUnitID,EmailAddress,streetAddress,PostalCode,City,Country,InvoiceStreetAddress,InvoicePostalCode,InvoiceCity,InvoiceCountry,Site,Telephone,RoleId,InsertDate,UpdateDate,DeleteDate,IsDeleted,Password,resetPasswordCode,IsEmailverify,ActivationCode,ConfirmPassword")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                customer.UpdateDate      = DateTime.UtcNow;
                db.Entry(customer).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }



            ViewBag.BusinessUnitID = new SelectList(db.BusinessUnits, "ID", "BusinessUnitName", customer.BusinessUnitID);
            ViewBag.RoleId         = new SelectList(db.Roles, "ID", "RoleName", customer.RoleId);
            return(View(customer));
        }
        public ActionResult Index(string Password, string newPassword, string ConfirmPassword)
        {
            Customer objlogin = new Customer();

            string EmailAddress = Session["UserEmail"].ToString();
            var    login        = db.Customers.Where(u => u.EmailAddress.Equals(EmailAddress)).FirstOrDefault();

            Console.WriteLine(login);

            if (login.Password == Password)
            {
                if (ConfirmPassword == newPassword)
                {
                    login.ConfirmPassword = ConfirmPassword;
                    login.Password        = newPassword;
                    db.Entry(login).State = EntityState.Modified;
                    try
                    {
                        db.SaveChanges();
                    }
                    catch (DbEntityValidationException e)
                    {
                        Console.WriteLine(e);
                    }
                    TempData["msg"] = "<script>alert('Password has been changed successfully !!!');</script>";
                    return(RedirectToAction("Login", "Home"));
                }

                else
                {
                    TempData["msg"] = "<script>alert('New password not match !!! Please check');</script>";
                }
            }

            else
            {
                TempData["msg"] = "<script>alert('Old password not match !!! Please check entered old password');</script>";
            }

            return(View());
        }