Exemplo n.º 1
0
 public DataSource(ModelDS clientModelDS)
 {
     // класс который объединяет клиентскую модель и данные из proxy
     // т.е. получает данные из сервиса и заполняет датасет модели на клиентской стороне
     dataSource = new Proxy.DataSource();
     modelDS    = clientModelDS;
 }
Exemplo n.º 2
0
        private void InitTabData(ModelDS.SiteMapRow mapRow, ModelDS.SiteMapRow parentMapRow, ModelDS.TabDataRow parentRow)
        {
            ModelDS.TabDataRow tabRow = data.TabData.NewTabDataRow();

            if (mapRow == null)
            {
                mapRow = data.SiteMap.Where(r => r.Key == TabModelHelper.TabModelType.CATEGORY.ToString()).FirstOrDefault();
                tabRow.SetParent_IdNull();
            }
            else
            {
                tabRow.Parent_Id = parentRow.Id;
            }

            tabRow.Name = mapRow.Title;
            tabRow.Key = mapRow.Key;
            tabRow.IsDefault = parentMapRow == null ? false : parentMapRow.DefaultKey == mapRow.Key;
            tabRow.Active = tabRow.IsDefault;
            data.TabData.AddTabDataRow(tabRow);

            foreach (ModelDS.SiteMapRow row in data.SiteMap.Where(r => !r.IsParent_IdNull() && r.Parent_Id == mapRow.Id))
            {
                InitTabData(row, mapRow, tabRow);
            }
        }
Exemplo n.º 3
0
        private void InitSiteMap(ISiteMapNode node, ModelDS.SiteMapRow parentRow)
        {
            ModelDS.SiteMapRow row = data.SiteMap.NewSiteMapRow();

            if (node == null)
            {
                node = SiteMapHelper.SiteMap.RootNode;
                row.SetParent_IdNull();
            }
            else
            {
                row.Parent_Id = parentRow.Id;
            }

            row.Title = node.Title;
            row.Action = node.Action;
            row.Controller = node.Controller;
            row.Key = node.Key;

            if (node.Attributes.Keys.Contains("defaultkey"))            
                row.DefaultKey = Convert.ToString(node.Attributes["defaultkey"]);
            else
                row.SetDefaultKeyNull();               

            data.SiteMap.AddSiteMapRow(row);

            foreach (ISiteMapNode childNode in node.ChildNodes)
            {
                InitSiteMap(childNode, row);
            }
        }