Example #1
0
        public ERItem(SPItemEventProperties properties, string ListRootFolderConfPropertyName = "")
        {
            using (SPSite site = new SPSite(properties.WebUrl))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    List <SPPrincipal> fieldsAssignees = new List <SPPrincipal>();

                    try
                    {
                        listItem = web.Lists[properties.ListId].GetItemById(properties.ListItemId);
                    }
                    catch
                    {
                        listItem = properties.ListItem;
                    }

                    if (listItem == null)
                    {
                        throw new ERItemListItemNullException("ERItem ListItem not found");
                    }
                }
            }

            eventProperties = properties;

            itemTitle = (listItem.Title != "" && listItem.Title != null) ? listItem.Title : listItem["FileLeafRef"].ToString();

            eventType = properties.EventType.ToString();

            if (ListRootFolderConfPropertyName != string.Empty)
            {
                ERConf = SPJsonConf <T> .Get(listItem.ParentList, ListRootFolderConfPropertyName);
            }
        }
        private void InitParams()
        {
            FieldName = Request.QueryString["Field"];
            Guid listGuid = new Guid(Request.QueryString["List"]);

            PageSPList = GetSPList(listGuid);

            ERConf = SPJsonConf <ERConfNotifications> .Get(PageSPList, CommonConfigNotif.LIST_PROPERTY_JSON_CONF);

            ERConfKey = (!String.IsNullOrEmpty(FieldName)) ? FieldName : "_listMode";

            FieldNameLabelText = (!String.IsNullOrEmpty(FieldName)) ? "field \"" + FieldName + "\"" : "list";
        }
        private void InitParams()
        {
            Guid listGuid = new Guid(Request.QueryString["List"]);

            PageSPList = GetSPList(listGuid);
            ListFields = PageSPList.Fields;

            ERConf = SPJsonConf <ERConfNotifications> .Get(PageSPList, CommonConfigNotif.LIST_PROPERTY_JSON_CONF);

            ERConfProperties = ERConf.GetType().GetProperties();

            //currentUrl = HttpContext.Current.Request.UrlReferrer.OriginalString;
            //currentUrl = HttpContext.Current.Request.Url.OriginalString;
            CurrentUrl       = HttpContext.Current.Request.RawUrl;
            MailTemplatesUrl = Regex.Replace(CurrentUrl, "Notifications", "MailTemplates", RegexOptions.IgnoreCase);
        }