예제 #1
0
        int countType = -1; //0 = Bin , 1 = PRODUCT


        public InventoryCountPresenter(IUnityContainer container, IInventoryCountView view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<InventoryCountModel>();


            View.FilterByBin += new EventHandler<DataEventArgs<string>>(View_FilterByBin);
            View.AddToAssigned += new EventHandler<EventArgs>(View_AddToAssigned);
            View.RemoveFromList += new EventHandler<EventArgs>(View_RemoveFromList);
            View.CreateNewTask += new EventHandler<EventArgs>(View_CreateNewTask);
            View.LoadDetails += new EventHandler<DataEventArgs<Document>>(View_LoadDetails);
            View.ShowTicket += new EventHandler<EventArgs>(View_ShowTicket);
            View.ChangeStatus += new EventHandler<EventArgs>(view_ChangeStatus);
            //View.BinTaskSelected += new EventHandler<DataEventArgs<ProductStock>>(View_BinTaskSelected);
            View.ChangeCountedQty += new EventHandler<DataEventArgs<object[]>>(View_ChangeCountedQty);
            View.ConfirmCountTask += new EventHandler<EventArgs>(View_ConfirmCountTask);
            View.CancelTask += new EventHandler<EventArgs>(View_CancelTask);
            View.SearchDocument += new EventHandler<DataEventArgs<string>>(View_SearchDocument);
            View.RefreshDocuments += new EventHandler<EventArgs>(View_RefreshDocuments);
            View.ReloadDocument += new EventHandler<EventArgs>(View_ReloadDocument);
            View.FilterByProduct += new EventHandler<DataEventArgs<Product>>(View_FilterByProduct);
            View.UpdateDocumentOption += new EventHandler<DataEventArgs<int>>(View_UpdateDocumentOption);
            View.ShowInitialTicket += new EventHandler<EventArgs>(View_ShowInitialTicket);
            View.LoadNoCountBalance += new EventHandler<EventArgs>(View_LoadNoCountBalance);
            View.SendAdjustment += new EventHandler<EventArgs>(View_SendAdjustment);
            View.ChangeSendOption += new EventHandler<EventArgs>(OnChangeSendOption);
            view.SelectAll += new EventHandler<EventArgs>(OnSelectAll);
            view.UnSelectAll += new EventHandler<EventArgs>(OnUnSelectAll);


            //DocType
            docType = new DocumentType { DocClass = new DocumentClass { DocClassID = SDocClass.Task } };
            docType.DocTypeID = SDocType.CountTask;

            ProcessWindow pw = new ProcessWindow("Loading Bin List ...");

            //oriAvailableBin = service.GetBin(new Bin { Location = App.curLocation }).OrderBy(f=> f.BinCode).ToList();
            oriAvailableBin = service.GetBin(new Bin()).OrderBy(f => f.BinCode).ToList();

            pw.Close();

            RefreshDocuments();
            
            //Product Categories
            try
            {
                IList<ProductCategory> list = service.GetProductCategory(new ProductCategory());
                list.Add(new ProductCategory { Name = "... Any Category"});
                View.Model.ProductCategories = list.OrderBy(f=>f.Name).ToList();
            }
            catch { }

            // CAA [2010/07/07]  Carga los filtros de busq de bines.
            IqReportColumn rc = new IqReportColumn();
            rc.Alias = "Filter by Bin";
            rc.FilteredValue = "";
            View.BFilters.cboStrComp.SelectedValue = " = _val";
            View.BFilters.RepColumn = rc;
        }