Example #1
0
 public bool CheckAll()
 {
     if (CustomerInvoiceGroups.Where(s => s.IsMail).Select(r => r.Email).Contains(string.Empty))
     {
         if (CustomerInvoiceGroups.Select(l => l.Label).Contains(null) ||
             CustomerInvoiceGroups.Select(s => s.Address1).Contains(null) ||
             CustomerInvoiceGroups.Select(z => z.ZipCode).Contains(null) ||
             CustomerInvoiceGroups.Select(c => c.City).Contains(null) ||
             CustomerInvoiceGroups.Select(cc => cc.Country).Contains(null) ||
             CustomerInvoiceGroups.Select(e => e.Email).Contains(string.Empty))
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     if (CustomerInvoiceGroups.Select(l => l.Label).Contains(null) ||
         CustomerInvoiceGroups.Select(s => s.Address1).Contains(null) ||
         CustomerInvoiceGroups.Select(z => z.ZipCode).Contains(null) ||
         CustomerInvoiceGroups.Select(c => c.City).Contains(null) ||
         CustomerInvoiceGroups.Select(cc => cc.Country).Contains(null))
     {
         return(false);
     }
     return(true);
 }
 private void ExecuteSaveInvoice(object obj)
 {
     _customerInvoiceGroup.CustomerID = _customer.CustomerID;
     if (CustomerInvoiceGroups.Select(l => l.Label).Contains(NewCigLabel) && !SelectedCIG.DefaultCig)
     {
         var result = MessageBox.Show("Do you want to overwrite existing customer invoice group?", "wait",
                                      MessageBoxButton.OKCancel);
         if (result == MessageBoxResult.OK)
         {
             Overwrite();
         }
     }
     else if (SelectedCIG != null && SelectedCIG.DefaultCig)
     {
         _invoice.CustomerInvoiceGroup = SelectedCIG;
         SaveInvoice();
     }
     else
     {
         _customerInvoiceGroup.Label   = NewCigLabel;
         _invoice.CustomerInvoiceGroup = _customerInvoiceGroup;
         SaveInvoice();
     }
 }
Example #3
0
        private void ExecuteCloseAndSaveCIGView(object obj)
        {
            _dataService.InsertCustomerInvoiceGroup(new ObservableCollection <CustomerInvoiceGroup>(CustomerInvoiceGroups.Select(f => f.CIG))).Subscribe(
                r =>
            {
                if (r.Success == false)
                {
                    MessageBox.Show(r.Response);
                }

                InternalCommands.UpdateCustomerInvoiceGroupList.Execute(_customer);
                InternalCommands.CustomerInvoiceGroupComplete.Execute(null);
            });
        }