public SiteMonitoring Create(Action <SiteMonitoring> updateMethod, IEnumerable <HttpPostedFileBase> files, int?contractDetailID, string[] noteList)
        {
            var contractDetailRepository = new ContractDetailRepository()
            {
                DB = DB
            };

            var contractDetail = contractDetailRepository.Get(contractDetailID.Value);

            SiteMonitoring e = new SiteMonitoring();

            updateMethod(e);

            e.ContractDetail = contractDetail;

            Save();

            PicasaRepository picasaRepository = new PicasaRepository();

            picasaRepository.DB = DB;

            picasaRepository.UploadPhoto(e, files, noteList, false);

            Save();

            return(e);
        }
Esempio n. 2
0
        public void DeletePhoto(List <int> IDList)
        {
            if (IDList != null)
            {
                List <SitePhoto> l = DB.SitePhotoes.Where(r => IDList.Contains(r.ID)).ToList();
                PicasaRepository picasaRepository = new PicasaRepository();
                foreach (var item in l)
                {
                    picasaRepository.DeletePhoto(item);
                    DB.DeleteObject(item);
                }

                Save();
            }
        }
Esempio n. 3
0
        public void DeletePhoto(List<int> IDList)
        {
            if (IDList != null)
            {
                List<SitePhoto> l = DB.SitePhotoes.Where(r => IDList.Contains(r.ID)).ToList();
                PicasaRepository picasaRepository = new PicasaRepository();
                foreach (var item in l)
                {
                    picasaRepository.DeletePhoto(item);
                    DB.DeleteObject(item);
                }

                Save();
            }
        }
        public SiteMonitoring Update(int ID, Action <SiteMonitoring> updateMethod, IEnumerable <HttpPostedFileBase> files, List <int> DeletePhotoList, IEnumerable <HttpPostedFileBase> filesOfFixed, string[] noteList, string[] noteOfFixedList)
        {
            SiteMonitoring e = Get(ID);

            updateMethod(e);

            Save();

            PicasaRepository picasaRepository = new PicasaRepository();

            picasaRepository.DB = DB;

            picasaRepository.UploadPhoto(e, files, noteList, false);
            picasaRepository.UploadPhoto(e, filesOfFixed, noteOfFixedList, false, true);

            DeletePhoto(DeletePhotoList);

            Save();

            return(e);
        }
Esempio n. 5
0
        public Site Add(Action<Site> updateMethod, IEnumerable<HttpPostedFileBase> files, string[] noteList)
        {
            Site e = new Site();
            updateMethod(e);

            UpdateFrontBackLit(e);
            UpdateGeo(e);
            //UpdateCategory(e);

            DB.Sites.AddObject(e);

            Save();

            PicasaRepository picasaRepository = new PicasaRepository();
            picasaRepository.DB = DB;

            picasaRepository.UploadPhoto(e, files, noteList);

            Save();

            return e;
        }
        public SiteMonitoring Create(Action<SiteMonitoring> updateMethod, IEnumerable<HttpPostedFileBase> files, int? contractDetailID, string[] noteList)
        {
            var contractDetailRepository = new ContractDetailRepository() { DB = DB };

            var contractDetail = contractDetailRepository.Get(contractDetailID.Value);

            SiteMonitoring e = new SiteMonitoring();

            updateMethod(e);

            e.ContractDetail = contractDetail;

            Save();

            PicasaRepository picasaRepository = new PicasaRepository();
            picasaRepository.DB = DB;

            picasaRepository.UploadPhoto(e, files, noteList, false);

            Save();

            return e;
        }
Esempio n. 7
0
        public void Update(int ID, Action <Site> updateMethod, IEnumerable <HttpPostedFileBase> files, List <int> DeletePhotoList, string[] noteList)
        {
            Site e = Get(ID);

            updateMethod(e);

            UpdateGeo(e);
            //UpdateCategory(e);

            UpdateFrontBackLit(e);

            Save();


            PicasaRepository picasaRepository = new PicasaRepository();

            picasaRepository.DB = DB;

            picasaRepository.UploadPhoto(e, files, noteList);

            DeletePhoto(DeletePhotoList);

            Save();
        }
Esempio n. 8
0
        public Site Add(Action <Site> updateMethod, IEnumerable <HttpPostedFileBase> files, string[] noteList)
        {
            Site e = new Site();

            updateMethod(e);

            UpdateFrontBackLit(e);
            UpdateGeo(e);
            //UpdateCategory(e);

            DB.Sites.AddObject(e);

            Save();

            PicasaRepository picasaRepository = new PicasaRepository();

            picasaRepository.DB = DB;

            picasaRepository.UploadPhoto(e, files, noteList);

            Save();

            return(e);
        }
Esempio n. 9
0
        public void Update(int ID, Action<Site> updateMethod, IEnumerable<HttpPostedFileBase> files, List<int> DeletePhotoList, string[] noteList)
        {
            Site e = Get(ID);

            updateMethod(e);

            UpdateGeo(e);
            //UpdateCategory(e);

            UpdateFrontBackLit(e);

            Save();

            PicasaRepository picasaRepository = new PicasaRepository();
            picasaRepository.DB = DB;

            picasaRepository.UploadPhoto(e, files, noteList);

            DeletePhoto(DeletePhotoList);

            Save();
        }
Esempio n. 10
0
        public SiteMonitoring Update(int ID, Action<SiteMonitoring> updateMethod, IEnumerable<HttpPostedFileBase> files, List<int> DeletePhotoList, IEnumerable<HttpPostedFileBase> filesOfFixed, string[] noteList, string[] noteOfFixedList)
        {
            SiteMonitoring e = Get(ID);

            updateMethod(e);

            Save();

            PicasaRepository picasaRepository = new PicasaRepository();
            picasaRepository.DB = DB;

            picasaRepository.UploadPhoto(e, files, noteList, false);
            picasaRepository.UploadPhoto(e, filesOfFixed, noteOfFixedList, false, true);

            DeletePhoto(DeletePhotoList);

            Save();

            return e;
        }