Пример #1
0
 public ActionResult SaveSangamBanner(HttpPostedFileBase file)
 {
     Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
     if (file != null && file.ContentLength > 0)
         try
         {
             string path = Path.Combine(Server.MapPath("~/Images/Mugurtham/Sangam/Banner"),
                                        objLoggedIn.sangamID + Path.GetExtension(Path.GetFileName(file.FileName)));
             file.SaveAs(path);
             Mugurtham.Core.Sangam.SangamCore objSangamCore = new Core.Sangam.SangamCore();
             using (objSangamCore as IDisposable)
             {
                 Mugurtham.Core.Sangam.SangamCoreEntity objSangamCoreEntity = new Core.Sangam.SangamCoreEntity();
                 using (objSangamCoreEntity as IDisposable)
                 {
                     objSangamCoreEntity = objSangamCore.GetByID(objLoggedIn.sangamID);
                     objSangamCoreEntity.BannerPath = "/Images/Mugurtham/Sangam/Banner/" + objLoggedIn.sangamID + Path.GetExtension(Path.GetFileName(file.FileName));
                     objSangamCore.Edit(ref objSangamCoreEntity);
                 }
                 objSangamCoreEntity = null;
             }
             objSangamCore = null;
         }
         catch (Exception ex)
         {
             ViewBag.Message = "ERROR:" + ex.Message.ToString();
         }
     else
     {
         ViewBag.Message = "You have not specified a file.";
     }
     return Redirect("/Mugurtham#/SangamAdminSettings");
 }
 public ActionResult SaveSangamBanner(HttpPostedFileBase file)
 {
     Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
     if (file != null && file.ContentLength > 0)
     {
         try
         {
             string path = Path.Combine(Server.MapPath("~/Images/Mugurtham/Sangam/Banner"),
                                        objLoggedIn.sangamID + Path.GetExtension(Path.GetFileName(file.FileName)));
             file.SaveAs(path);
             Mugurtham.Core.Sangam.SangamCore objSangamCore = new Core.Sangam.SangamCore(objLoggedIn.ConnectionStringAppKey);
             using (objSangamCore as IDisposable)
             {
                 Mugurtham.Core.Sangam.SangamCoreEntity objSangamCoreEntity = new Core.Sangam.SangamCoreEntity();
                 using (objSangamCoreEntity as IDisposable)
                 {
                     objSangamCoreEntity            = objSangamCore.GetByID(objLoggedIn.sangamID);
                     objSangamCoreEntity.BannerPath = "/Images/Mugurtham/Sangam/Banner/" + objLoggedIn.sangamID + Path.GetExtension(Path.GetFileName(file.FileName));
                     objSangamCore.Edit(ref objSangamCoreEntity);
                 }
                 objSangamCoreEntity = null;
             }
             objSangamCore = null;
         }
         catch (Exception ex)
         {
             ViewBag.Message = "ERROR:" + ex.Message.ToString();
         }
     }
     else
     {
         ViewBag.Message = "You have not specified a file.";
     }
     return(Redirect("/Matrimony#/SangamAdminSettings"));
 }
Пример #3
0
 public HttpResponseMessage GetLookupDTO()
 {
     List<Mugurtham.Core.Sangam.SangamCoreEntity> objSangamCoreEntityList = new List<Core.Sangam.SangamCoreEntity>();
     Mugurtham.Core.Sangam.SangamCore objSangamCore = new Core.Sangam.SangamCore();
     using (objSangamCore as IDisposable)
         objSangamCore.GetAll(ref objSangamCoreEntityList);
     return Request.CreateResponse(HttpStatusCode.OK, objSangamCoreEntityList, Configuration.Formatters.JsonFormatter);
 }
Пример #4
0
        public HttpResponseMessage GetLookupDTO()
        {
            List <Mugurtham.Core.Sangam.SangamCoreEntity> objSangamCoreEntityList = new List <Core.Sangam.SangamCoreEntity>();

            Mugurtham.Core.Login.LoggedInUser objLoggedIn = new Core.Login.LoggedInUser(Request.Headers.GetValues("MugurthamUserToken").FirstOrDefault(),
                                                                                        Request.Headers.GetValues("CommunityID").FirstOrDefault());
            Mugurtham.Core.Sangam.SangamCore objSangamCore = new Core.Sangam.SangamCore(objLoggedIn.ConnectionStringAppKey);
            using (objSangamCore as IDisposable)
                objSangamCore.GetAll(ref objSangamCoreEntityList);
            return(Request.CreateResponse(HttpStatusCode.OK, objSangamCoreEntityList, Configuration.Formatters.JsonFormatter));
        }