コード例 #1
0
 public SPOSitePipeBind(SPOSite site)
 {
     if (string.IsNullOrEmpty(site.Url))
     {
         throw new PSArgumentException("Site Url must be specified");
     }
     _url = site.Url?.TrimEnd(new char[] { '/' });
 }
コード例 #2
0
 private void SetupContribute()
 {
     if (IsManager)
     {
         item = (ItemID == 0) ? new SPA.SPOSite() : new SPA.SPOSite(ItemID);
     }
     else
     {
         Response.Redirect(string.Format("{0}/{1}?code={2}", SPContext.Current.Web.Url, Message.URL_USERMESSAGE, Message.Code.MngrAccessReq), false);
     }
 }
コード例 #3
0
        public SPOSite GetSite(bool detailed)
        {
            if (_detailedSite != null)
            {
                return(_detailedSite);
            }
            if (_site != null && !detailed)
            {
                return(_site);
            }

            var site = Context.Site;

            SPOSite.LoadSite(Context, site, detailed);

            return(new SPOSite(site));
        }
コード例 #4
0
        private bool SaveItem()
        {
            bool success = false;

            try {
                bool isUpdate = (IView == ItemView.Edit);
                item            = (isUpdate) ? new SPA.SPOSite(ItemID) : new SPA.SPOSite();
                item.URL        = txtURL.Text.Trim();
                item.Title      = txtTitle.Text.Trim();
                item.Template   = txtTemplate.Text.Trim();
                item.ModifiedBy = CurrentUser.DisplayName;

                if (!isUpdate)
                {
                    item.CreatedBy = item.ModifiedBy;
                    if (item.Insert())
                    {
                        success = true;
                    }
                }
                else
                {
                    if (item.Update())
                    {
                        success = true;
                    }
                }
                ItemID = (success) ? item.ID : 0;
            } catch (Exception ex) {
                SPA.Error.WriteError(ex);
                if (ShowDebug)
                {
                    lblErrorMessage.Text = ex.ToString();
                }
            }
            return(success);
        }