ASR.DomainObjects.ReportItem.CreateFromParameters C# (CSharp) Метод

CreateFromParameters() публичный статический Метод

public static CreateFromParameters ( NameValueCollection nvc ) : ReportItem
nvc System.Collections.Specialized.NameValueCollection
Результат ReportItem
        public static ReportItem CreateFromParameters(NameValueCollection nvc)
        {
            Assert.IsNotNull(nvc, "Incorrect Parameters Format");
            var id = nvc["id"];
            if (id == null) return null;
            var database = Sitecore.Configuration.Factory.GetDatabase(Settings.Instance.ConfigurationDatabase);
            var reportItem = new ReportItem(database.GetItem(id));

            if (reportItem == null) throw new Exception("Report has been deleted");

            foreach (string key in nvc.Keys)
            {
                if (key.Contains("^"))
                {
                    var item_parameter = key.Split('^');
                    var guid = new ID(item_parameter[0]);

                    var ri = reportItem.FindItem(guid);
                    if (ri != null)
                    {
                        ri.SetAttributeValue(item_parameter[1], nvc[key]);
                    }
                }
            }
            return reportItem;
        }

Same methods

ReportItem::CreateFromParameters ( string parameters ) : ReportItem