Esempio n. 1
0
        protected bool UpsertSEO(IWithSEO Entity, int SEOID, SEO SEO, HttpPostedFileBase[] SEOfile, string ModelName)
        {
            try{
                if (SEOID > 0)
                {
                    var SEOEntity = Uow.SEORepository.GetByID(SEOID);
                    UpdateModel(SEOEntity);
                }
                else if (SEO != null)
                {
                    Uow.SEORepository.Add(SEO);
                    Uow.Commit();
                    Entity.SeoId = SEO.SEO_ID;
                }


                if (SEOfile != null && SEOfile[0] != null)
                {
                    Entity.SEO.ogImage += SEOfile.FBSaveImages(Server.MapPath("/Images/SEO/"), ModelName);
                }
            }
            catch {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        protected void UpsertSEO(IWithSEO Entity, int SEOID, SEO POSTSEO, HttpPostedFileBase[] SEOfile, string ModelName)
        {
            if (SEOID > 0)
            {
                var SEOEntity = Uow.SEORepository.GetByID(SEOID);
                UpdateModel(SEOEntity);
            }
            else if (POSTSEO != null)
            {
                Uow.SEORepository.Add(POSTSEO);
                Uow.Commit();
                Entity.SeoId = POSTSEO.SEO_ID;
            }

            if (SEOfile != null && SEOfile[0] != null)
                Entity.SEO.ogImage += SEOfile.FBSaveImages(Server.MapPath("/Images/SEO/"), ModelName);
        }