예제 #1
0
        void MoveMaschine()
        {
            if (this.mySelectedMachine == null)
            {
                return;
            }
            var modell = this.mySelectedMachine.Modellbezeichnung;
            var msg    = string.Empty;
            var csv    = new CustomerSearchView("Zu welchem Kunden soll die Maschine verschoben werden?", false);

            if (csv.ShowDialog() != DialogResult.OK || csv.SelectedCustomer == null)
            {
                return;
            }

            if (this.myKunde.CustomerId == csv.SelectedCustomer.Kundennummer)
            {
                msg = string.Format("Die Maschine gehört doch schon zu {0}", myKunde.Matchcode);
                MetroMessageBox.Show(this, msg, "Äh ...");
                return;
            }

            var zielKunde = ModelManager.CustomerService.GetKunde(csv.SelectedCustomer.Kundennummer, false);

            if (zielKunde != null)
            {
                ModelManager.MachineService.TransferMachine(this.mySelectedMachine, this.myKunde, zielKunde);
                msg = string.Format("Die Maschine '{0}' wurde zu '{1}' verschoben.", modell, csv.SelectedCustomer.Name1);
                MetroMessageBox.Show(this, msg);
            }
        }
예제 #2
0
        public HttpResponseMessage postSearch(CustomerSearchView model)
        {
            try
            {
                var result = customerService.Search(model);

                return(Request.CreateResponse(HttpStatusCode.OK, result));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.ToString()));
            }
        }
예제 #3
0
        public CommonSearchView <CustomerView> Search(CustomerSearchView model)
        {
            using (var ctx = new ConXContext())
            {
                //define model view
                CommonSearchView <CustomerView> view = new ModelViews.CommonSearchView <ModelViews.CustomerView>()
                {
                    pageIndex   = model.pageIndex - 1,
                    itemPerPage = model.itemPerPage,
                    totalItem   = 0,

                    datas = new List <ModelViews.CustomerView>()
                };

                //query data
                List <cust_mast> CustMasts = ctx.CustMasts
                                             .Where(x => (x.cust_name.Contains(model.name) || model.name == "") ||
                                                    (x.address1.Contains(model.name)) ||
                                                    (x.address2.Contains(model.name))
                                                    )
                                             .OrderBy(o => o.customerId)
                                             .ToList();

                //count , select data from pageIndex, itemPerPage
                view.totalItem = CustMasts.Count;
                CustMasts      = CustMasts.Skip(view.pageIndex * view.itemPerPage)
                                 .Take(view.itemPerPage)
                                 .ToList();

                //prepare model to modelView
                foreach (var i in CustMasts)
                {
                    view.datas.Add(new ModelViews.CustomerView()
                    {
                        customerId  = i.customerId,
                        cust_name   = i.cust_name,
                        address1    = i.address1,
                        address2    = i.address2,
                        subDistrict = i.subDistrict,
                        district    = i.district,
                        province    = i.province,
                        zipCode     = i.zipCode,
                        tel         = i.tel
                    });
                }

                //return data to contoller
                return(view);
            }
        }
예제 #4
0
        public void LoadCustomerSearch()
        {
            PosContext.Instance.KeysByControl.Clear();

            object view = _regionManager.Regions[Regions.LeftMenuRegion].GetView("ActiveView");

            if (view != null)
            {
                _regionManager.Regions[Regions.LeftMenuRegion].Remove(view);
            }

            CustomerSearchView customerSearchView = _container.Resolve <CustomerSearchView>("CustomerSearch");

            _regionManager.Regions[Regions.LeftMenuRegion].Add(customerSearchView, "ActiveView");
            customerSearchView.LoadControls();

            BottomMenuView bottomMenu = _container.Resolve <BottomMenuView>();

            bottomMenu.LoadControls();

            object view1 = _regionManager.Regions[Regions.KeyPadRegion].GetView("ActiveView");

            if (view1 != null)
            {
                _regionManager.Regions[Regions.KeyPadRegion].Remove(view1);
            }

            KeyPadView keyPad = _container.Resolve <KeyPadView>("KeyPadView");

            _regionManager.Regions[Regions.KeyPadRegion].Add(keyPad, "ActiveView");
            keyPad.LoadControls();
            PosContext.Instance.Receipt.OperDisplayTotals = (PosTicketTotal)keyPad;


            InvoiceTotalView invTot = _container.Resolve <InvoiceTotalView>();
            //invTot.LoadControls();
        }