public ContentBlock()
 {
     this.BaseSettings = new ContentBlockSettings();
     this.Lists        = new ContentBlockSettingList();
     this.Bvin         = string.Empty;
     this.StoreId      = 0;
     this.LastUpdated  = DateTime.UtcNow;
     this.ColumnId     = string.Empty;
     this.SortOrder    = 1;
     this.ControlName  = string.Empty;
 }
 public ContentBlock()
 {
     this.BaseSettings = new ContentBlockSettings();
     this.Lists = new ContentBlockSettingList();
     this.Bvin = string.Empty;
     this.StoreId = 0;
     this.LastUpdated = DateTime.UtcNow;
     this.ColumnId = string.Empty;
     this.SortOrder = 1;
     this.ControlName = string.Empty;
 }
        public bool FromXml(ref System.Xml.XmlReader xr)
        {
            bool results = false;

            try
            {
                while (xr.Read())
                {
                    if (xr.IsStartElement())
                    {
                        if (!xr.IsEmptyElement)
                        {
                            switch (xr.Name)
                            {
                            case "Bvin":
                                xr.Read();
                                Bvin = xr.ReadString();
                                break;

                            case "ControlName":
                                xr.Read();
                                ControlName = xr.ReadString();
                                break;

                            case "SortOrder":
                                xr.Read();
                                SortOrder = int.Parse(xr.ReadString());
                                break;

                            case "ColumnId":
                                xr.Read();
                                ColumnId = xr.ReadString();
                                break;

                            case "SerializedSettings":
                                xr.Read();
                                string json = xr.ReadString();
                                this.BaseSettings = MerchantTribe.Web.Json.ObjectFromJson <ContentBlockSettings>(json);
                                break;

                            case "Lists":
                                xr.Read();
                                string jsonlist = xr.ReadString();
                                this.Lists = MerchantTribe.Web.Json.ObjectFromJson <ContentBlockSettingList>(jsonlist);
                                break;
                            }
                        }
                    }
                }

                results = true;
            }

            catch (XmlException XmlEx)
            {
                EventLog.LogEvent(XmlEx);
                results = false;
            }

            return(results);
        }
        public bool FromXml(ref System.Xml.XmlReader xr)
        {
            bool results = false;

            try
            {
                while (xr.Read())
                {
                    if (xr.IsStartElement())
                    {
                        if (!xr.IsEmptyElement)
                        {
                            switch (xr.Name)
                            {
                                case "Bvin":
                                    xr.Read();
                                    Bvin = xr.ReadString();
                                    break;
                                case "ControlName":
                                    xr.Read();
                                    ControlName = xr.ReadString();
                                    break;
                                case "SortOrder":
                                    xr.Read();
                                    SortOrder = int.Parse(xr.ReadString());
                                    break;
                                case "ColumnId":
                                    xr.Read();
                                    ColumnId = xr.ReadString();
                                    break;
                                case "SerializedSettings":
                                    xr.Read();
                                    string json = xr.ReadString();
                                    this.BaseSettings = MerchantTribe.Web.Json.ObjectFromJson<ContentBlockSettings>(json);
                                    break;
                                case "Lists":
                                    xr.Read();
                                    string jsonlist = xr.ReadString();
                                    this.Lists = MerchantTribe.Web.Json.ObjectFromJson<ContentBlockSettingList>(jsonlist);
                                    break;
                            }
                        }
                    }
                }

                results = true;
            }

            catch (XmlException XmlEx)
            {
                EventLog.LogEvent(XmlEx);
                results = false;
            }

            return results;

        }