Example #1
0
        // Delegate function that's called by the SomeoneIsCalling event handler.
        private void ShowCustomerDashboardView(string theCallersId)
        {
            string customerId = Data.DataManager.DataService.GetCustomerIdByFonNumber(theCallersId);

            if (!string.IsNullOrEmpty(customerId))
            {
                Model.Entities.Customer     customer = Model.ModelManager.ModelService.GetCustomerById(customerId);
                Views.CustomerDashboardView cgv      = new CustomerDashboardView(customer);
                cgv.Show();
            }
        }
Example #2
0
 private bool SearchCustomer(string searchFor)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         Products.Common.SortableBindingList <Model.Entities.Customer> list = Model.ModelManager.ModelService.GetCustomersByAny(searchFor);
         if (list == null || list.Count == 0)
         {
             errSearch.SetError(this.txtSearchCustomer, "Sieht so aus, als hätten wir keinen solchen Kunden");
             this.txtSearchCustomer.SelectAll();
             return(false);
         }
         errSearch.SetError(txtSearchCustomer, string.Empty);
         if (list.Count == 1)
         {
             Views.CustomerDashboardView cgv = new CustomerDashboardView(list[0]);
             cgv.Show();
             this.txtSearchCustomer.SelectAll();
             return(true);
         }
         else
         {
             CustomerSearchView2 csv       = new CustomerSearchView2(list);
             DialogResult        dlgResult = csv.ShowDialog(this);
             if (dlgResult == System.Windows.Forms.DialogResult.OK && csv.CurrentCustomer != null)
             {
                 Model.Entities.Customer     customer = csv.CurrentCustomer;
                 Views.CustomerDashboardView cgv      = new CustomerDashboardView(customer);
                 cgv.Show();
                 return(true);
             }
             this.txtSearchCustomer.SelectAll();
             return(false);
         }
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Example #3
0
 private bool SearchCustomer(string searchFor)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         Products.Common.SortableBindingList <Model.Entities.Kunde> list = Model.ModelManager.ModelService.GetCustomersByAny(searchFor);
         if (list == null || list.Count == 0)
         {
             this.txtSuchDenLump.SelectAll();
             return(false);
         }
         if (list.Count == 1)
         {
             Views.CustomerDashboardView cgv = new CustomerDashboardView(list[0]);
             cgv.Show();
             this.txtSuchDenLump.SelectAll();
             return(true);
         }
         else
         {
             CustomerSearchView2 csv       = new CustomerSearchView2(list);
             DialogResult        dlgResult = csv.ShowDialog(this);
             if (dlgResult == System.Windows.Forms.DialogResult.OK && csv.CurrentCustomer != null)
             {
                 Model.Entities.Kunde        customer = csv.CurrentCustomer;
                 Views.CustomerDashboardView cgv      = new CustomerDashboardView(customer);
                 cgv.Show();
                 return(true);
             }
             this.txtSuchDenLump.SelectAll();
             return(false);
         }
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Example #4
0
        private void lnkCustomerGeneralView_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            CustomerDashboardView cgv = new CustomerDashboardView(Model.ModelManager.ModelService.GetCustomerById("1000000000"));

            cgv.Show(this);
        }