示例#1
0
 public CustomerSidesReport(MainDataContexts dataContexts,CustomerSidesSelection.CustomerInfo reportedCustomer, List<CustomerLink> reportedLinks)
 {
     InitializeComponent();
     _dataContexts = dataContexts;
     _reportedLinks = reportedLinks;
     _dataSet=new ReportDataSet();
     _reportedCustomer = reportedCustomer;
 }
 private void miClientSidesReport_Click(object sender, EventArgs e)
 {
     if (SharedAppData.IsAccesible(CustomerSidesSelection.ObjectAccessId))
     {
         if (_sidesReportFormInstance == null || _sidesReportFormInstance.IsDisposed)
         {
             _sidesReportFormInstance = new CustomerSidesSelection(_dataContexts, this);
             equipmentDetails.OnUpdateData += _sidesReportFormInstance.RefreshDataNotifier;
             areaDetails.OnUpdateData += _sidesReportFormInstance.RefreshDataNotifier;
             _dataContexts.SetAdvDependencyHandler(_sidesReportFormInstance.RefreshDataNotifier);
             _sidesReportFormInstance.Closing += (_, __) =>
             {
                 equipmentDetails.OnUpdateData -= _sidesReportFormInstance.RefreshDataNotifier;
                 areaDetails.OnUpdateData -= _sidesReportFormInstance.RefreshDataNotifier;
                 _dataContexts.RemoveAdvDependencyHandler(_sidesReportFormInstance.RefreshDataNotifier);
             };
         }
         if (_sidesReportFormInstance.WindowState != FormWindowState.Minimized)
             _sidesReportFormInstance.Show(this);
         _sidesReportFormInstance.WindowState = FormWindowState.Normal;
         _sidesReportFormInstance.BringToFront();
     }
     else
     {
         MessageBox.Show(@"Отсутсвуют права на использование " + CustomerSidesSelection.ObjectAccessId.Description + @"!");
     }
 }