private async Task<object> LoadFormData(IForm formData, ISpreadsheetControl spreadsheetControl)
        {
            var data = await Repo.GetFile(formData.file_id);
            var excelData = data != null ? data.contents : null;
            if (excelData == null)
            {
                this.ShowFlyoutMessageBox("Информация", "Не удалось загрузить данные формы", FlyoutCommand.OK);
                spreadsheetControl.CreateNewDocument();
                return null;
            }
            using (var ms = new MemoryStream(excelData))
            {
                var format = DocumentFormat.OpenXml;
                spreadsheetControl.LoadDocument(ms, format);
                spreadsheetControl.Document.History.IsEnabled = true;
                spreadsheetControl.Document.Worksheets.ActiveWorksheet = spreadsheetControl.Document.Worksheets.FirstOrDefault();
            }

            return null;
        }
 private async Task<object> LoadTemplate(form form, ISpreadsheetControl spreadsheetControl)
 {
     if (form.template_file_id == null)
     {
         this.ShowFlyoutMessageBox("Информация", string.Format("У формы {0} отсутствует шаблон", form), FlyoutCommand.OK);
         spreadsheetControl.CreateNewDocument();
         return null;
     }
     var template = await Repo.GetFile(form.template_file_id.Value);
     var excelData = template != null ? template.contents : null;
     if (excelData == null)
     {
         this.ShowFlyoutMessageBox("Информация", "Не удалось загрузить шаблон", FlyoutCommand.OK);
         spreadsheetControl.CreateNewDocument();
         return null;
     }
     using (var ms = new MemoryStream(excelData))
     {
         var format = DocumentFormat.OpenXml;
         spreadsheetControl.LoadDocument(ms, format);
         spreadsheetControl.Document.History.IsEnabled = true;
         spreadsheetControl.Document.Worksheets.ActiveWorksheet = spreadsheetControl.Document.Worksheets.FirstOrDefault();
     }
     return null;
 }