コード例 #1
0
        private void DisplayCustomerDocument(FileDetail doc)
        {
            if (_SelectedBuilding == null)
            {
                Controller.HandleError("Please select a building", "Validation Error");
                return;
            }
            var filerData = clientPortal.GetBuildingFile(_SelectedBuilding.ID, doc.Id);

            DisplayPDF(filerData);
        }
コード例 #2
0
        private void fileList_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int index = this.fileList.IndexFromPoint(e.Location);

            if (index != System.Windows.Forms.ListBox.NoMatches)
            {
                building = buildings[cmbBuilding.SelectedIndex - 1];

                var    file     = (fileList.Items[index] as FileDetail);
                byte[] fileData = _ClientPortal.GetBuildingFile(building.ID, file.Id);

                string fileName = Path.Combine(Path.GetTempPath(), file.File);
                if (File.Exists(fileName))
                {
                    File.Delete(fileName);
                }

                File.WriteAllBytes(fileName, fileData);

                Process.Start(fileName);
            }
        }