Esempio n. 1
0
        public IFootPrintService AddOrUpdateFootPrint(User.IUserService user, UpdateFootPrintModel model)
        {
            IFootPrintStrategy strategy;

            if (model.Pid > 0)
            {
                strategy = new ProjFootPrintWithPidStrategy(user, model, _FootPrintServiceFactory, _FootPrintRepository, _StaticResourceManager, _ProjSourceManager, _FootPrintImgRepository);
            }
            else
            {
                strategy = new ProjFootPrintWithNameStrategy(user, model, _FootPrintServiceFactory, _FootPrintRepository, _StaticResourceManager, _ProjSourceManager, _FootPrintImgRepository);
            }

            var service = strategy.SaveFootPrint();

            var fid         = service.Fid;
            var taskFactory = new TaskFactory().StartNew(() =>
            {
                var url   = "http://api.fc.t.tgnet.com/Api/InitFootPrintAddress";
                var query = new System.Collections.Specialized.NameValueCollection();
                query.Add("fid", fid.ToString());
                FCRMAPI.RequstUtility.TransmitToMQ(url, query, null);
            });

            return(service);
        }
Esempio n. 2
0
        public void InitFootPrintAddress(User.IUserService user)
        {
            var model = new UpdateFootPrintModel()
            {
                Fid       = _LazyEntity.Value.fid,
                Pid       = _LazyEntity.Value.pid,
                Address   = _LazyEntity.Value.address,
                Latitude  = _LazyEntity.Value.latitude,
                Longitude = _LazyEntity.Value.longitude,
            };

            model.Images = this.Imgs.Select(p => new FootImageInfo()
            {
                ImageKey  = p.imageKey,
                Address   = p.address,
                Latitude  = p.latitude,
                Longitude = p.longitude,
            }).ToArray();
            var strategy = new ProjFootPrintWithPidStrategy(user, model, _FootPrintServiceFactory, _FootPrintRepository, _StaticResourceManager, _ProjSourceManager, _FootPrintImgRepository);

            strategy.InitFootPrintAddress();
        }