Esempio n. 1
0
 private static void WriteFixedHeader(RVS_Property row, RvsSavedProperties properties)
 {
     row.FixedHeader = new XElement("Root",
                                    new XElement("IsFixedHeader", properties.IsFixedHeader.ToString()),
                                    new XElement("FixedRowsCount", properties.FixedRowsCount.ToString()),
                                    new XElement("FixedColumnsCount", properties.FixedColumnsCount.ToString()));
 }
Esempio n. 2
0
 private static void ReadStorageValues(RVS_Property row, RvsSavedProperties properties)
 {
     if (row.StorageValues != null && row.StorageValues.Length > 0)
     {
         properties.StorageValues = StorageValues.Deserialize(row.StorageValues.ToArray());
     }
 }
Esempio n. 3
0
 private static void WriteStorageValues(RVS_Property row, RvsSavedProperties properties)
 {
     if (properties.StorageValues != null)
     {
         row.StorageValues = new Binary(properties.StorageValues.Serialize());
     }
 }
Esempio n. 4
0
        private static RvsSavedProperties LoadFrom(DB_RvsSettingsDataContext db, RVS_Property row)
        {
            if (row == null)
            {
                return(null);
            }
            var properties = new RvsSavedProperties
            {
                Grouping         = row.Grouping.Elements("GroupColumn").Select(r => (GroupColumn)r.Value).ToList(),
                OrderByColumns   = row.OrderByColumns == null ? null : string.Join(",", row.OrderByColumns.Elements("OrderColumn").Select(r => r.Value).ToArray()),
                PageUrl          = row.Filter == null ? null : row.Filter.Value,
                ReportPluginName = row.ReportPluginName,
                NameRu           = row.nameRu,
                NameKz           = row.nameKz,
                JournalTypeName  = row.JournalTypeName,
            };

            ReadFixedHeader(row, properties);
            ReadColumnHierarchy(row, properties);
            ReadRowsProperties(row, properties);
            ReadStorageValues(row, properties);
            ReadCellsProperties(row, properties);
            ReadOtherParameters(row, properties);
            return(properties);
        }
Esempio n. 5
0
        private static void WriteCellsProperties(RVS_Property row, RvsSavedProperties properties)
        {
            var serializer = new XmlSerializer(typeof(List <CellProperties>));
            var xmlDoc     = new XDocument();

            using (var writer = xmlDoc.CreateWriter())
                serializer.Serialize(writer, properties.DataCellProperties);
            row.CellsStyle = new XElement("CellsProperties", xmlDoc.Root);
        }
Esempio n. 6
0
        private static void ReadColumnHierarchy(RVS_Property row, RvsSavedProperties properties)
        {
            var serializer = new XmlSerializer(typeof(List <ColumnHierarchy>));
            List <ColumnHierarchy> colH;

            using (var stream = row.ColumnsStyle.CreateReader())
                colH = (List <ColumnHierarchy>)serializer.Deserialize(stream);
            properties.ColumnHierarchy = colH;
        }
Esempio n. 7
0
        private static void WriteOtherParameters(RVS_Property row, RvsSavedProperties properties)
        {
            var serializer = new XmlSerializer(typeof(List <ConcatenateColumnTransporter>));
            var xmlDoc     = new XDocument();

            using (var writer = xmlDoc.CreateWriter())
                serializer.Serialize(writer, properties.ConcatenateColumns);
            row.OtherParameters = new XElement("Root",
                                               new XElement("ConcatenateColumns", xmlDoc.Root));
        }
Esempio n. 8
0
        private static void WriteColumnHierarchy(RVS_Property row, RvsSavedProperties properties)
        {
            var serializer = new XmlSerializer(typeof(List <ColumnHierarchy>));
            var xmlDoc     = new XDocument();

            using (var writer = xmlDoc.CreateWriter())
            {
                serializer.Serialize(writer, properties.ColumnHierarchy);
                writer.Flush();
                writer.Close();
                row.ColumnsStyle = xmlDoc.Root;
            }
        }
Esempio n. 9
0
        private static void ReadCellsProperties(RVS_Property row, RvsSavedProperties properties)
        {
            var serializer = new XmlSerializer(typeof(List <CellProperties>));

            if (row.CellsStyle == null)
            {
                return;
            }
            var element = row.CellsStyle.Elements().FirstOrDefault();

            if (element != null)
            {
                using (var stream = element.CreateReader())
                    properties.DataCellProperties = (List <CellProperties>)serializer.Deserialize(stream);
            }
        }
Esempio n. 10
0
        private static void ReadRowsProperties(RVS_Property row, RvsSavedProperties properties)
        {
            var serializer = new XmlSerializer(typeof(List <RowProperties>));
            var eHR        = row.RowsStyle.Element("HeaderRowsProperties");

            if (eHR != null)
            {
                using (var stream = eHR.Elements().First().CreateReader())
                    properties.HeaderRowsProperties = (List <RowProperties>)serializer.Deserialize(stream);
            }
            var eDR = row.RowsStyle.Element("DataRowsProperties");

            if (eDR != null)
            {
                using (var stream = eDR.Elements().First().CreateReader())
                    properties.DataRowsProperties = (List <RowProperties>)serializer.Deserialize(stream);
            }
        }
Esempio n. 11
0
        private static void ReadOtherParameters(RVS_Property row, RvsSavedProperties properties)
        {
            if (row.OtherParameters == null)
            {
                return;
            }

            var serializer = new XmlSerializer(typeof(List <ConcatenateColumnTransporter>));
            var element    = row.OtherParameters.Element("ConcatenateColumns");

            if (element != null)
            {
                var doc = element.Elements().FirstOrDefault();
                if (doc != null)
                {
                    using (var stream = doc.CreateReader())
                        properties.ConcatenateColumns =
                            (List <ConcatenateColumnTransporter>)serializer.Deserialize(stream);
                }
            }
        }
Esempio n. 12
0
        private RVS_Property SaveProperties(DB_RvsSettingsDataContext db)
        {
            var row = new RVS_Property
            {
                Grouping         = new XElement("Root", Grouping.Select(r => new XElement("GroupColumn", r.ToString()))),
                OrderByColumns   = new XElement("Root", (OrderByColumns ?? "").Split(',').Select(r => new XElement("OrderColumn", r.ToString()))),
                Filter           = string.IsNullOrEmpty(PageUrl) ? null : new XElement("PageUrl", PageUrl),
                ReportPluginName = ReportPluginName,
                nameRu           = NameRu,
                nameKz           = NameKz,
                JournalTypeName  = JournalTypeName,
            };

            WriteFixedHeader(row, this);
            WriteColumnHierarchy(row, this);
            WriteRowsProperties(row, this);
            WriteStorageValues(row, this);
            WriteCellsProperties(row, this);
            WriteOtherParameters(row, this);
            db.RVS_Properties.InsertOnSubmit(row);
            return(row);
        }
Esempio n. 13
0
        private static void WriteRowsProperties(RVS_Property row, RvsSavedProperties properties)
        {
            var      serializer = new XmlSerializer(typeof(List <RowProperties>));
            var      xmlDoc     = new XDocument();
            XElement eHR;
            XElement eDR;

            using (var writer = xmlDoc.CreateWriter())
            {
                serializer.Serialize(writer, properties.HeaderRowsProperties);
                writer.Flush();
                writer.Close();
                eHR = new XElement("HeaderRowsProperties", xmlDoc.Root);
            }
            xmlDoc = new XDocument();
            using (var writer = xmlDoc.CreateWriter())
            {
                serializer.Serialize(writer, properties.DataRowsProperties);
                writer.Flush();
                writer.Close();
                eDR = new XElement("DataRowsProperties", xmlDoc.Root);
            }
            row.RowsStyle = new XElement("Root", eHR, eDR);
        }
Esempio n. 14
0
 partial void InsertRVS_Property(RVS_Property instance);
Esempio n. 15
0
 private static void ReadFixedHeader(RVS_Property row, RvsSavedProperties properties)
 {
     properties.IsFixedHeader     = row.FixedHeader.GetElementValue <bool>("IsFixedHeader") ?? true;
     properties.FixedRowsCount    = row.FixedHeader.GetElementValue <int>("FixedRowsCount") ?? 0;
     properties.FixedColumnsCount = row.FixedHeader.GetElementValue <int>("FixedColumnsCount") ?? 1;
 }
Esempio n. 16
0
 partial void DeleteRVS_Property(RVS_Property instance);
Esempio n. 17
0
 partial void UpdateRVS_Property(RVS_Property instance);