public ActionResult Edit(int id, upload_image img)
 {
     try
     {
         if (img.ImageFile != null)
         {
             string fileName  = Path.GetFileNameWithoutExtension(img.ImageFile.FileName);
             string extension = Path.GetExtension(img.ImageFile.FileName);
             fileName     = fileName + DateTime.Now.ToString("yymmssfff") + extension;
             img.img_path = "~/User-Images/" + fileName;
             fileName     = Path.Combine(Server.MapPath("~/User-Images/"), fileName);
             img.ImageFile.SaveAs(fileName);
         }
         using (SocietyofACEntities1 db = new SocietyofACEntities1())
         {
             db.Entry(img).State = EntityState.Modified;
             db.SaveChanges();
         }
         return(RedirectToAction("Events"));
     }
     catch
     {
         return(View());
     }
 }
        public ActionResult Edit(string Email, Registration reg, HttpPostedFileBase postedFile)
        {
            try
            {
                // TODO: Add update logic here
                if (postedFile != null)
                {
                    string filename   = Path.GetFileNameWithoutExtension(postedFile.FileName);
                    string Extenttion = Path.GetExtension(postedFile.FileName);
                    filename      = filename + DateTime.Now.ToString("yymmssfff") + Extenttion;
                    reg.Imagepath = "~/User-Images/" + filename;
                    filename      = Path.Combine(Server.MapPath("~/User-Images/"), filename);
                    postedFile.SaveAs(filename);
                }
                using (SocietyofACEntities1 db = new SocietyofACEntities1())
                {
                    db.Entry(reg).State = EntityState.Modified;
                    db.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }