Ejemplo n.º 1
0
        public override void Add(Content.Models.Repository repository, Content.Models.SendingSetting item)
        {
            base.Add(repository, item);
            if (Site.Current != null && item.SendToChildSites.HasValue && item.SendToChildSites.Value == true)
            {
                var repositoryList = GetAllRepositoriesForChildSites(Site.Current, item.ChildLevel);

                foreach (var repo in repositoryList)
                {
                    try
                    {
                        if (repo != repository)
                        {
                            ReceivingSetting rece = new ReceivingSetting()
                            {
                                KeepStatus        = item.KeepStatus,
                                ReceivingFolder   = item.FolderName,
                                Repository        = repo,
                                SendingFolder     = item.FolderName,
                                SendingRepository = repository.Name
                            };

                            Kooboo.CMS.Content.Services.ServiceFactory.ReceiveSettingManager.Add(repo, rece);
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public ReceivingSettingPath(ReceivingSetting receiveSetting)
        {
            var fileName = receiveSetting.Name + ".config";

            this.SettingFile = this.PhysicalPath = Path.Combine(new BroadcastingPath(receiveSetting.Repository).PhysicalPath, DIR, fileName);
            //this.VirtualPath = UrlUtility.Combine(new BroadcastingPath().PhysicalPath, DIR, fileName);
        }
Ejemplo n.º 3
0
        public virtual ActionResult Create(ReceivingSetting model, string repository, string @return)
        {
            var data = new JsonResultData(ModelState);

            data.RunWithTry((resultData) =>
            {
                if (ModelState.IsValid)
                {
                    Manager.Add(Repository, model);
                    resultData.RedirectUrl = @return;
                }
            });

            return(Json(data));
        }
Ejemplo n.º 4
0
        public virtual ActionResult Edit(ReceivingSetting model, string @return)
        {
            var data = new JsonResultData(ModelState);

            if (ModelState.IsValid)
            {
                data.RunWithTry((resultData) =>
                {
                    model.Repository = Repository;
                    Manager.Remove(Repository, model);
                    Manager.Add(Repository, model);
                    resultData.RedirectUrl = @return;
                });
            }

            return(Json(data));
        }
Ejemplo n.º 5
0
        public virtual ActionResult Create(ReceivingSetting model, string repository)
        {
            var entry = new JsonResultEntry();

            if (ModelState.IsValid)
            {
                try
                {
                    Manager.Add(Repository, model);
                    entry.SetSuccess();
                }
                catch (Exception e)
                {
                    entry.AddException(e);
                }
            }
            else
            {
                entry.AddModelState(ModelState);
            }

            return(Json(entry));
        }
Ejemplo n.º 6
0
 public ReceivingSettingPath(ReceivingSetting receiveSetting)
 {
     var fileName = receiveSetting.Name + ".config";
     this.SettingFile = this.PhysicalPath = Path.Combine(new BroadcastingPath(receiveSetting.Repository).PhysicalPath, DIR, fileName);
     //this.VirtualPath = UrlUtility.Combine(new BroadcastingPath().PhysicalPath, DIR, fileName);
 }