Example #1
0
        void OpenLinkedItem()
        {
            var item = this.mySelectedLinkedItem;

            if (item == null)
            {
                return;
            }

            switch (item.LinkTypBezeichnung)
            {
            case "Kunde":
                var kmv = new KundeMainView(item as Kunde);
                kmv.Show();
                break;

            case "Kundenmaschine":
                var machine = item as Kundenmaschine;
                var kunde   = machine.CurrentOwner;
                kmv = new KundeMainView(kunde, machine);
                kmv.Show();
                break;

            case "Kundenkontakt":
                var contact = item as Kundenkontakt;
                kunde = ModelManager.CustomerService.GetKunde(contact.Kundennummer, false);
                kmv   = new KundeMainView(kunde, contact);
                kmv.Show();
                break;
            }
        }
        void CreateKundenmaschine()
        {
            if (this.SelectedMachine == null)
            {
                MetroMessageBox.Show(this, "Du musst erst eine Kundenmaschine auswählen. Das neue Maschine wird dann das selbe Modell haben.");
                return;
            }
            Kunde           kunde       = null;
            Maschinenmodell modell      = this.SelectedMachine.Maschinenmodell;
            User            currentUser = ModelManager.UserService.CurrentUser;

            var csv = new CustomerSearchView("Für welchen Kunden soll die neue Maschine erfasst werden?", true);

            if (csv.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                kunde = ModelManager.CustomerService.GetKunde(csv.SelectedCustomer.Kundennummer, false);
            }

            var neueMaschine = ModelManager.MachineCreatorService.CreateKundenmaschine(kunde, modell, currentUser, string.Empty);

            if (neueMaschine != null)
            {
                var kmv = new KundeMainView(kunde, neueMaschine);
                kmv.Show();
            }
        }
Example #3
0
        private void ShowCPM()
        {
            var wir = ModelManager.CustomerService.GetKunde("1000000000", true);
            var kmv = new KundeMainView(wir);

            kmv.Show();
        }
Example #4
0
 void OpenCustomerPanel()
 {
     if (this.mySelectedKunde != null)
     {
         var kmv = new KundeMainView(mySelectedKunde);
         kmv.Show();
     }
 }
Example #5
0
        void ShowMachine()
        {
            if (this.SelectedMaschinenauftrag == null || this.SelectedMaschinenauftrag.Maschine == null)
            {
                return;
            }
            var kmv = new KundeMainView(this.SelectedMaschinenauftrag.Auftragskunde, this.SelectedMaschinenauftrag.Maschine);

            kmv.Show();
        }
        void xcmdOpenCustomer_Click(object sender, EventArgs e)
        {
            if (this.SelectedMachine == null)
            {
                MetroMessageBox.Show(this, "Du musst erst eine Kundenmaschine auswählen.");
                return;
            }
            var kmv = new KundeMainView(this.SelectedMachine.CurrentOwner);

            kmv.Show();
        }
        void OpenMaschine()
        {
            if (this.SelectedMachine == null)
            {
                MetroMessageBox.Show(this, "Du musst erste eine Kundenmaschine auswählen.");
                return;
            }
            var kmv = new KundeMainView(this.SelectedMachine.CurrentOwner, this.SelectedMachine);

            kmv.Show();
        }
        void ShowKunde()
        {
            if (this.mySelectedKunde == null)
            {
                return;
            }
            Model.ModelManager.CustomerService.CurrentCustomer = this.mySelectedKunde;
            var kmv = new KundeMainView(this.mySelectedKunde);

            kmv.Show();
            if (!this.mchkDontClose.Checked)
            {
                this.Close();
            }
        }
Example #9
0
        //bool SuchKunde(string searchFor)
        //{
        //	try
        //	{
        //		this.Cursor = Cursors.WaitCursor;
        //		var list = ModelManager.CustomerService.GetKundenSucheResults(searchFor);
        //		if (list == null || list.Count == 0)
        //		{
        //			errSearch.SetError(this.mtxtSearch, "Sieht aus, als hätten wir keinen solchen Kunden");
        //			this.mtxtSearch.SelectAll();
        //			return false;
        //		}
        //		errSearch.SetError(mtxtSearch, string.Empty);
        //		if (list.Count == 1)
        //		{
        //			var kunde = ModelManager.CustomerService.GetKunde(list[0].Kundennummer);
        //			var kmv = new KundeMainView(kunde);
        //			kmv.Show();
        //			return true;
        //		}
        //		else
        //		{
        //			var csv = new CustomerSearchView1(list, searchFor);
        //			var dlgResult = csv.ShowDialog(this);
        //			if (dlgResult == DialogResult.OK && csv.SelectedSuchkunde != null)
        //			{
        //				var kunde = ModelManager.CustomerService.GetKunde(csv.SelectedSuchkunde.Kundennummer);
        //				var kmv = new KundeMainView(kunde);
        //				kmv.Show();
        //				return true;
        //			}
        //			this.mtxtSearch.SelectAll();
        //			return false;
        //		}
        //	}
        //	finally
        //	{
        //		this.Cursor = Cursors.Default;
        //	}
        //}

        private bool SearchCustomer()
        {
            if (string.IsNullOrEmpty(this.SearchText) || string.IsNullOrWhiteSpace(this.SearchText))
            {
                return(false);
            }

            var list = ModelManager.CustomerService.GetKundenSucheResults(this.SearchText);

            if (list == null || list.Count == 0)
            {
                var msg = string.Format("Die Suche nach '{0}' ergab leider garnichts.", this.SearchText);
                errSearch.SetError(this.mtxtSearch, msg);
                this.mtxtSearch.SelectAll();
                return(false);
            }
            errSearch.SetError(mtxtSearch, string.Empty);
            if (list.Count == 1)
            {
                var kunde = ModelManager.CustomerService.GetKunde(list[0].Kundennummer, true);
                this.AddRecentCustomer(kunde);
                var kmv = new KundeMainView(kunde);
                this.Cursor = Cursors.Default;
                kmv.Show();
                return(true);
            }
            var csv1      = new CustomerSearchView1(list, this.SearchText);
            var dlgResult = csv1.ShowDialog(this);

            if (dlgResult == DialogResult.OK && csv1.SelectedSuchkunde != null)
            {
                var kunde = ModelManager.CustomerService.GetKunde(csv1.SelectedSuchkunde.Kundennummer, true);
                this.AddRecentCustomer(kunde);
                var kmv = new KundeMainView(kunde);
                kmv.Show();
                return(true);
            }
            this.mtxtSearch.SelectAll();
            return(false);
        }
Example #10
0
        private void mlnkCurrentCustomer_Click(object sender, EventArgs e)
        {
            switch (this.mradioArtikel.Checked)
            {
            case true:
                var product = this.mlnkCurrentElement.Tag as Product;
                if (product != null)
                {
                    var adv = new ArtikelDetailView(product, ModelManager.CustomerService.GetCPM());
                    adv.Show();
                }
                break;

            case false:
                var kunde = this.mlnkCurrentElement.Tag as Kunde;
                if (kunde != null)
                {
                    var kmv = new KundeMainView(kunde);
                    kmv.Show();
                }
                break;
            }
        }
Example #11
0
        // Delegate function that's called by the SomeoneIsCalling event handler.
        private void ShowCustomerDashboardView(string theCallersId)
        {
            var customerId = Data.DataManager.AllDataService.GetCustomerIdByFonNumber(theCallersId);

            if (!string.IsNullOrEmpty(customerId))
            {
                var           customer = ModelManager.CustomerService.GetKunde(customerId, true);
                Kundenkontakt contact  = null;
                if (customer != null)
                {
                    if (contact != null)
                    {
                        var kmv = new KundeMainView(customer, contact);
                        kmv.Show();
                    }
                    else
                    {
                        var kmv = new KundeMainView(customer);
                        kmv.Show();
                    }
                }
            }
        }
        void CreateKundenmaschine()
        {
            if (this.SelectedModel == null)
            {
                MetroMessageBox.Show(this, "Dazu musst Du in der Liste erst ein Modell auswählen.");
                return;
            }
            Kunde           kunde  = null;
            Maschinenmodell modell = this.SelectedModel;

            var csv = new CustomerSearchView("Für welchen Kunden soll die neue Maschine erfasst werden?", true);

            if (csv.ShowDialog(this) == DialogResult.OK && csv.SelectedCustomer != null)
            {
                kunde = ModelManager.CustomerService.GetKunde(csv.SelectedCustomer.Kundennummer, true);
                var neueMaschine = ModelManager.MachineCreatorService.CreateKundenmaschine(kunde, modell, ModelManager.UserService.CurrentUser, string.Empty);
                if (neueMaschine != null)
                {
                    var kmv = new KundeMainView(kunde, neueMaschine);
                    kmv.Show();
                }
            }
        }
Example #13
0
        void ShowCustomer()
        {
            var kmv = new KundeMainView(this.myMaschinenauftrag.Maschine.CurrentOwner);

            kmv.Show();
        }
Example #14
0
        void ShowMachine()
        {
            var kmv = new KundeMainView(this.myMaschinenauftrag.Maschine.CurrentOwner, this.myMaschinenauftrag.Maschine);

            kmv.Show();
        }