public MessageRuleByCompanyPresenter(IUnityContainer container, IMessageRuleByCompanyView view) { View = view; this.container = container; this.service = new WMSServiceClient(); View.Model = this.container.Resolve<MessageRuleByCompanyModel>(); //Event Delegate View.LoadSearch += new EventHandler<DataEventArgs<string>>(this.OnLoadSearch); View.New += new EventHandler<EventArgs>(this.OnNew); View.LoadData += new EventHandler<DataEventArgs<MessageRuleByCompany>>(this.OnLoadData); View.Save += new EventHandler<EventArgs>(this.OnSave); View.Delete += new EventHandler<EventArgs>(this.OnDelete); View.Model.ClassEntityList = service.GetClassEntity(new ClassEntity()); view.Model.LabelTemplateList = service.GetLabelTemplate(new LabelTemplate { LabelType = new DocumentType { DocClass = new DocumentClass { DocClassID = SDocClass.Message } } }); View.Model.EntityList = service.GetMessageRuleByCompany(new MessageRuleByCompany()); View.Model.Record = null; }
public ProductPresenter(IUnityContainer container, IProductView view) { View = view; this.container = container; this.service = new WMSServiceClient(); View.Model = this.container.Resolve<ProductModel>(); //Event Delegate View.LoadSearch += new EventHandler<DataEventArgs<string>>(this.OnLoadSearch); View.New += new EventHandler<EventArgs>(this.OnNew); View.LoadData += new EventHandler<DataEventArgs<Product>>(this.OnLoadData); View.Save += new EventHandler<EventArgs>(this.OnSave); View.Delete += new EventHandler<EventArgs>(this.OnDelete); View.AssignBinToProduct += new EventHandler<DataEventArgs<Bin>>(OnAssignBinToProduct); View.RemoveFromList += new EventHandler<EventArgs>(this.OnRemoveFromList); View.AddProductTrackOption += new EventHandler<EventArgs>(OnAddProductTrackOption); View.AddProductUnit += new EventHandler<EventArgs>(OnAddProductUnit); View.LoadUnitsFromGroup += new EventHandler<EventArgs>(OnLoadUnitsFromGroup); //View.LoadBins += new EventHandler<DataEventArgs<string>>(OnLoadBins); View.SetRequired += new EventHandler<DataEventArgs<object>>(View_SetRequired); View.UnSetRequired += new EventHandler<DataEventArgs<object>>(View_UnSetRequired); View.UpdateBinToProduct += new EventHandler<DataEventArgs<ZoneBinRelation>>(View_UpdateBinToProduct); View.AddAlternateProduct += new EventHandler<EventArgs>(View_AddAlternateProduct); View.AddProductAccount += new EventHandler<DataEventArgs<ProductAccountRelation>>(View_AddProductAccount); View.UpdateProductAccount += new EventHandler<DataEventArgs<object>>(View_UpdateProductAccount); //View.SetIsMain += new EventHandler<DataEventArgs<object>>(View_SetIsMain); //View.UnSetIsMain += new EventHandler<DataEventArgs<object>>(View_UnSetIsMain); ProcessWindow pw = new ProcessWindow("Loading ..."); View.Model.EntityList = service.GetProductApp(new Product { Company = App.curCompany, Reference = App.curLocation.LocationID.ToString() }, 25); View.Model.Record = null; View.Model.StatusList = App.EntityStatusList; //Load Pick Methods View.Model.PickMethods = App.PickMethodList; view.Model.TemplateList = service.GetLabelTemplate(new LabelTemplate { LabelType = new DocumentType { DocTypeID = LabelType.ProductLabel } }); view.Model.TemplateList.Add(new LabelTemplate()); //List Height View.ListRecords.MaxHeight = SystemParameters.FullPrimaryScreenHeight - 250; View.Model.CurAltern = new ProductAlternate(); //USE CASN if (Util.GetConfigOption("USECASN").Equals("T")) View.TbItmCasN.Visibility = Visibility.Visible; pw.Close(); }
public LabelTemplatePresenter(IUnityContainer container, ILabelTemplateView view) { View = view; this.container = container; this.service = new WMSServiceClient(); View.Model = this.container.Resolve<LabelTemplateModel>(); //Event Delegate View.LoadSearch += new EventHandler<DataEventArgs<string>>(this.OnLoadSearch); View.New += new EventHandler<EventArgs>(this.OnNew); View.LoadData += new EventHandler<DataEventArgs<LabelTemplate>>(this.OnLoadData); View.Save += new EventHandler<EventArgs>(this.OnSave); View.Delete += new EventHandler<EventArgs>(this.OnDelete); //View.Model.LabelTypeList = service.GetLabelType(); View.Model.EntityList = service.GetLabelTemplate(new LabelTemplate()); View.Model.LabelTypeList = service.GetDocumentType(new DocumentType()) .Where(f => f.DocClass.DocClassID == 10 || f.DocClass.DocClassID == 11 || f.DocClass.DocClassID == 12).ToList(); View.Model.Record = null; }
//Obtiene la configuracion del sistema y public static Dictionary<string, string> GetConfigOptionValues() { WMSServiceClient service = new WMSServiceClient(); IList<ConfigType> list = service.GetConfigType(new ConfigType()); IList<ConfigOptionByCompany> listOptions; IList<ConfigOption> generalOptions; Dictionary<String, String> curInternal = new Dictionary<string, string>(); foreach (ConfigType cType in list) { if (cType.ConfigTypeID == 1) { //general { generalOptions = service.GetConfigOption(new ConfigOption { ConfigType = new ConfigType { ConfigTypeID = 1 } }); foreach (ConfigOption option in generalOptions.Where(f => f.ConfigType.ConfigTypeID == cType.ConfigTypeID)) curInternal.Add(option.Code, option.DefValue); } else { listOptions = service.GetConfigOptionByCompany(new ConfigOptionByCompany { Company = App.curCompany }); foreach (ConfigOptionByCompany option in listOptions.Where(f => f.ConfigOption.ConfigType.ConfigTypeID == cType.ConfigTypeID)) curInternal.Add(option.ConfigOption.Code, option.Value); } } //Configuracion de algunos defaults try { App.defTemplate = service.GetLabelTemplate(new LabelTemplate { RowID = int.Parse(curInternal["PROTEMPL"]) }).First(); } catch { } return curInternal; }