public ActionResult EditMPs(string EncryptedId)
 {
     if (!string.IsNullOrEmpty(EncryptedId))
     {
         OurMps OurMps = _aboutUsDao.GetOurMpsByGuid(new Guid(EncryptedId));
         return(View(OurMps));
     }
     return(View());
 }
        public ActionResult EditMPs(OurMps OM)
        {
            if (OM.Image != null && OM.Image.ContentLength > 0)
            {
                OM.ImageExtension = Path.GetExtension(OM.Image.FileName).Trim('.');
                OM.ImageName      = Path.GetFileNameWithoutExtension(OM.Image.FileName);
                OM.ImageGUID      = Guid.NewGuid().ToString("N");
                string Imagelocation = Server.MapPath("~/Resources/Images/OurMps/" + OM.ImageGUID + "." + OM.ImageExtension);
                OM.Image.SaveAs(Imagelocation);
            }
            Int64 Result = _aboutUsDao.SaveOurMps(OM);

            if (Result > 0)
            {
                return(RedirectToRoute("OurMPs"));
            }

            return(View());
        }
        public ActionResult Preview(OurMps OM)
        {
            if (OM.Image != null && OM.Image.ContentLength > 0)
            {
                OM.ImageExtension = Path.GetExtension(OM.Image.FileName).Trim('.');
                OM.ImageName      = Path.GetFileNameWithoutExtension(OM.Image.FileName);
                OM.ImageGUID      = Guid.NewGuid().ToString("N");
                string Imagelocation = Server.MapPath("~/Resources/Images/OurMps/" + OM.ImageGUID + "." + OM.ImageExtension);
                OM.Image.SaveAs(Imagelocation);
            }

            OurMpsContents ourMps = new OurMpsContents();

            ourMps.OurMps = OM;
            ViewBannerModel viewBanner = _bannerDao.GetViewBanner();

            if (viewBanner != null && viewBanner.AboutUsBanner != null && viewBanner.AboutUsBanner.Count > 0)
            {
                ourMps.AboutUsBanner = viewBanner.AboutUsBanner.Where(s => s.Page == "Our MPs").FirstOrDefault();
            }
            return(View(ourMps));
        }