Ejemplo n.º 1
0
        public async Task <IActionResult> Putuser(int id, user user)
        {
            if (id != user.id)
            {
                return(BadRequest());
            }

            _context.Entry(user).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!userExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 2
0
        public ActionResult Forget_Password(string email)
        {
            if (email != null)
            {
                if (ModelState.IsValid)
                {
                    user user = db.users.Where(u => u.email == email).FirstOrDefault();
                    if (user != null)//if user exist
                    {
                        string To = email, UserID, Password, SMTPPort, Host;
                        string token = Convert.ToBase64String(Guid.NewGuid().ToByteArray());
                        token             = token.Replace("=", "");
                        token             = token.Replace("[", "");
                        token             = token.Replace("+", "");
                        token             = token.Replace("]", "");
                        token             = token.Replace("/", "");
                        user.token        = token;
                        user.timeforreset = DateTime.Now.AddHours(24);
                        db.users.Attach(user);
                        db.Entry(user).Property("token").IsModified        = true;
                        db.Entry(user).Property("timeforreset").IsModified = true;
                        db.SaveChanges();

                        var lnkHref = "<a href='" + Url.Action("resetpassword", "Authentication", new { email = email, token = token }, "http") + "'>Click this link to set a new password.</a>";

                        //HTML Template for Send email

                        string subject = "Your changed password";

                        string body = "<b>We have received a request to change your password.</b><br/>" + "</br>" + lnkHref + "<br/>" + "<p>If you did not make this request then you can simply ignore this email.</p><br/><p>Thanks,<br/><br/><b>Seozilla Support</b></p>" + "<hr>" + "<img src='http://www.seozilla.co.uk/wp-content/uploads/2017/11/cropped-logo-home.png'/>" + "<br/>" + "<b>Telephone:</b> 020 3808 7777 <p><b>Website: </b>http://seozilla.co.uk/</p>" + "<br/>" + "<p style='font-size: 10px;'><b>Registered Address:</b>86-90 Paul Street,London,EC2A 4NE</p></br><p style='font-size: 10px;'><b>Disclaimer:</b> This message (and any attachments) is private and confidential and may contain personal data or personal views which are not the views of Seozilla unless specifically stated. If you have received this message in error, please notify us and remove it from your system. Do not use, copy or disclose the information in any way.</p>";


                        //Get and set the AppSettings using configuration manager.

                        emailmanager.Appsettings(out UserID, out Password, out SMTPPort, out Host);

                        //Call send email methods.

                        emailmanager.SendEmail(UserID, subject, body, To, UserID, Password, SMTPPort, Host);
                    }
                }
            }
            return(RedirectToAction("forget_password_message", "Authentication"));
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "ID,firstname,lastname,email,country,password,Roles, telephone, company, building, addressline1, addressline2, city, postcode")] user user)
 {
     if (ModelState.IsValid)
     {
         dal dl = new dal();
         if (dl.getuser(user.email, user.password).password == user.password)
         {
             db.Entry(user).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         else
         {
             ModelState.AddModelError("Incorrect Password", "Incorrect Password");
             return(View(user));
         }
     }
     return(View(user));
 }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "ID,firstname,lastname,email,country,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 = "ID,orderdate,duedate,status,comment,tags,userID")] order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.userID = new SelectList(db.users, "ID", "firstname", order.userID);
     return(View(order));
 }
 public ActionResult Edit([Bind(Include = "ID,orderdate,duedate,status,comment,tags,userID,daordered,wordcount,anchortext,targeturl,posttitle,postplacement,da")] blog blog)
 {
     if (ModelState.IsValid)
     {
         db.Entry(blog).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.userID = new SelectList(db.users, "ID", "firstname", blog.userID);
     return(View(blog));
 }
Ejemplo n.º 7
0
        public ActionResult Edit([Bind(Include = "ID,plan,url1,url2,url3,keyword1a,keyword1b,keyword2a,keyword2b,keyword3a,keyword3b,cloudurl,orderID")] zillalinkbuilding zillalinkbuilding)
        {
            int orderid = zillalinkbuilding.orderID;

            if (ModelState.IsValid)
            {
                db.Entry(zillalinkbuilding).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Details", "orders", new { @id = orderid }));
            }
            return(View(zillalinkbuilding));
        }
        public ActionResult Edit([Bind(Include = "ID,plan,pageurl,primekeyword,secondarykeyword,targetlocation,orderID")] zillaonpage zillaonpage)
        {
            int orderid = zillaonpage.orderID;

            if (ModelState.IsValid)
            {
                db.Entry(zillaonpage).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Details", "orders", new { @id = orderid }));
            }
            ViewBag.orderID = new SelectList(db.orders, "ID", "orderno", zillaonpage.orderID);
            return(View(zillaonpage));
        }
        public ActionResult Edit([Bind(Include = "ID,plan,keyword1,keyword2,keyword3,competitor1,competitor2,competitor3,targetlocation,otherinfo,orderID")] zillax zillax)
        {
            int orderid = zillax.orderID;

            if (ModelState.IsValid)
            {
                db.Entry(zillax).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Details", "orders", new { @id = orderid }));
            }
            ViewBag.orderID = new SelectList(db.orders, "ID", "orderno", zillax.orderID);
            return(View(zillax));
        }
        public ActionResult Edit([Bind(Include = "ID,plan,country,businessname,websiteurl,businessdescription,keywords,founder,address,phone,email,cloudurl,orderID")] citation citation)
        {
            int orderid = citation.orderID;

            if (ModelState.IsValid)
            {
                db.Entry(citation).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Details", "orders", new { @id = orderid }));
            }
            ViewBag.orderID = new SelectList(db.orders, "ID", "orderno", citation.orderID);
            return(View(citation));
        }
Ejemplo n.º 11
0
        public ActionResult Edit([Bind(Include = "ID,words,quantity,title,website,brief,orderID, document_url")] zillablog zillablog)
        {
            int orderid = zillablog.orderID;

            if (ModelState.IsValid)
            {
                db.Entry(zillablog).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Details", "orders", new { @id = orderid }));
            }
            ViewBag.orderID = new SelectList(db.orders, "ID", "orderno", zillablog.orderID);
            return(View(zillablog));
        }
Ejemplo n.º 12
0
        public ActionResult Edit([Bind(Include = "ID,daordered,wordcount,anchortext,targeturl,posttitle,postplacement,da,orderID")] blog blog)
        {
            int orderid = blog.orderID;

            if (ModelState.IsValid)
            {
                db.Entry(blog).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Details", "orders", new { @id = orderid }));
            }
            ViewBag.orderID = new SelectList(db.orders, "ID", "orderno", blog.orderID);
            return(View(blog));
        }