コード例 #1
0
 // For each server create sheets and add titles if does not exist
 public void Create()
 {
     foreach (var serverInfo in ServerInfos)
     {
         GService.CreateSheet(serverInfo.ServerName);
         GService.Update(new List <IList <object> >()
         {
             new List <object>()
             {
                 "Сервер", "База данных", "Размер в ГБ", "Дата обновления"
             }
         }, serverInfo.ServerName);
     }
 }
コード例 #2
0
        public void Update()
        {
            //date of update
            var date = DateTime.Now.Date.ToString("MM.dd.yyyy");

            foreach (var serverInfo in ServerInfos)    // each of servers
            {
                var data = serverInfo.GetInfo().Result // data with updated information about server
                           .Select(x => new List <object>()
                {
                    serverInfo.ServerName, x.Name, x.Size, date
                })
                           .Select(x => (IList <object>)x)
                           .ToList();
                data.Add(new List <object>()
                {
                    serverInfo.ServerName, "Свободно", serverInfo.SizeLeft, date
                });                                                                                            // add last row with size left
                GService.Update(data, serverInfo.ServerName, 1);
            }
        }