private void putAwayButton_Click(object sender, EventArgs e) { if (!dxValidationProvider1.Validate()) { return; } if (SelectedItem == null) { return; } RackLocation location = rackSelList.EditValue as RackLocation; if (location != null) { int qty = Int32.Parse(qtyText.Text); Domain domain = domainSelList.EditValue as Domain; string comments = commentsText.Text; if (MaterialService.TransferMaterialToLocation(SelectedItem, domain, location.Label, qty, comments)) { Scout.Core.UserInteraction.Dialog.ShowMessage("Material Transferred.", UserMessageType.Information); Reset(); } } }
public SiteVisitDetails(User user, int siteVisitId, bool readOnly) : base(user, "SiteVisit:" + siteVisitId) { InitializeComponent(); this.IsReadOnly = readOnly; var service = new MaterialService(user); var model = service.GetSiteVisit(siteVisitId); var viewModel = new SiteVisitViewModel(model); this.DataContext = viewModel; txtCollector.BindUser(user); viewModel.DataChanged += new DataChangedHandler(viewModel_DataChanged); tab.AddTabItem("Traits", new TraitControl(user, TraitCategoryType.SiteVisit, viewModel) { IsReadOnly = readOnly }); tab.AddTabItem("Notes", new NotesControl(user, TraitCategoryType.SiteVisit, viewModel) { IsReadOnly = readOnly }); tab.AddTabItem("Ownership", new OwnershipDetails(model)); }
protected override void ProcessImpl(User user) { var service = new MaterialService(user); Model.ElemID = service.InsertSiteVisit(Model.ParentID, TemplateID); UpdateChildrenParentID(); }
protected override Data.Model.BioLinkDataObject GetModel() { var service = new MaterialService(User); OwnedDataObject obj = null; switch (ElemType) { case "Region": obj = service.GetRegion(ObjectID); break; case "Site": obj = service.GetSite(ObjectID); break; case "SiteVisit": obj = service.GetSiteVisit(ObjectID); break; case "Material": obj = service.GetMaterial(ObjectID); break; case "SiteGroup": break; case "Trap": obj = service.GetTrap(ObjectID); break; } return(obj); }
public AspectMainViewModel(IEventAggregator eventAggregator, IDataService <LabDbEntities> labDbData, MaterialService materialService) : base() { _labDbData = labDbData; _eventAggregator = eventAggregator; _materialService = materialService; CreateAspectCommand = new DelegateCommand( () => { Aspect tempAspect = _materialService.CreateAspect(); if (tempAspect != null) { _eventAggregator.GetEvent <AspectChanged>() .Publish(new EntityChangedToken(tempAspect, EntityChangedToken.EntityChangedAction.Created)); } _aspectList = null; RaisePropertyChanged("AspectList"); }, () => CanModify); RemoveAspectCommand = new DelegateCommand( () => { _selectedAspect.Delete(); SelectedAspect = null; RaisePropertyChanged("AspectList"); }, () => false); }
public IHttpActionResult Get(Guid eventId) { var service = new MaterialService(); var data = service.GetFile(eventId.ToString()); return(Ok(data)); }
protected override void ProcessImpl(User user) { var service = new MaterialService(user); Model.ElemID = service.InsertTrap(Model.ParentID, Model.Name); UpdateChildrenParentID(); }
public override bool Validate(List <string> messages) { if (Preferences.AccessionNumberIsMandatory.Value) { if (string.IsNullOrWhiteSpace(_viewModel.AccessionNumber)) { messages.Add("You must provide an Accession number. (See Tools -> Settings -> Preferences to turn off mandatory accession numbers)"); } } if (Preferences.UniqueAccessionNumbers.Value) { if (!string.IsNullOrWhiteSpace(_viewModel.AccessionNumber)) { var service = new MaterialService(User); var candidateIds = service.GetMaterialIdsByAccessionNo(_viewModel.AccessionNumber); var firstDuplicate = candidateIds.FirstOrDefault((id) => { return(id != _viewModel.MaterialID); }); if (firstDuplicate > 0) { messages.Add("There is already material in the database with Accession number " + _viewModel.AccessionNumber + " (Material ID " + firstDuplicate + ")"); } } } return(messages.Count == 0); }
public async Task <ActionResult> MaterialDelete(Guid id) { var materialService = new MaterialService(); await materialService.RemoveMaterial(id); return(RedirectToAction(nameof(MaterialList))); }
public ActionResult Edit(string materialNumber, string MATERIALIDVENDOR, string MATERIALTYPE, string MATERIALGROUP, string OLDMATERIAL, string BOMMATERIAL, string BRAND, string MODEL, string GARDAN, string YEAR, string PURCHASEGROUPID, string DESCRIPTION, string PRICELIST) { try { MSMATERIAL model = new MSMATERIAL(); model.MATERIALNUMBER = materialNumber; model.MATERIALIDVENDOR = MATERIALIDVENDOR; model.MATERIALGROUP = MATERIALGROUP; model.OLDMATERIAL = OLDMATERIAL; model.BRAND = BRAND; model.MODEL = MODEL; model.GARDAN = GARDAN; model.YEAR = YEAR; model.PURCHASEGROUPID = PURCHASEGROUPID; model.DESCRIPTION = DESCRIPTION; model.PRICELIST = PRICELIST == "" ? 0 : double.Parse(PRICELIST); IMaterialService svc = new MaterialService(); //model.MODEL = MDL; var result = svc.Edit(materialNumber, model); return(RedirectToAction("Index")); } catch (Exception ex) { general.AddLogError("Material Edit", ex.Message, ex.StackTrace); return(View("~/Views/Master/Material/Edit.cshtml")); } }
public MaterialAddEdit() { InitializeComponent(); listMaterial = MaterialService.getMaterials(); listMaterial.ForEach(x => x.Quantity = 0); updateGrid(); }
public ActionResult Add(string materialNumber, string MATERIALIDVENDOR, string MATERIALTYPE, string MATERIALGROUP, string OLDMATERIAL, string BOMMATERIAL, string BRAND, string MODEL, string GARDAN, string YEAR, string PURCHASEGROUPID, string DESCRIPTION, string PRICELIST) { try { MSMATERIAL model = new MSMATERIAL(); model.MATERIALNUMBER = materialNumber; model.MATERIALIDVENDOR = MATERIALIDVENDOR; model.MATERIALGROUP = MATERIALGROUP; model.OLDMATERIAL = OLDMATERIAL; model.BRAND = BRAND; model.MODEL = MODEL; model.GARDAN = GARDAN; model.YEAR = YEAR; model.PURCHASEGROUPID = PURCHASEGROUPID; model.DESCRIPTION = DESCRIPTION; model.PRICELIST = PRICELIST == "" ? 0 : double.Parse(PRICELIST); IMaterialService svc = new MaterialService(); var result = svc.Add(model); this.AddNotification("Your Data Has Been Successfully Saved. ", NotificationType.SUCCESS); return(RedirectToAction("Index")); } catch (Exception ex) { general.AddLogError("Material Add", ex.Message, ex.StackTrace); this.AddNotification("ID exist", NotificationType.ERROR); this.ViewBag.purchaseId = GetPurchaseID(); return(View("~/Views/Master/Material/Add.cshtml")); //throw; } }
public ActionResult Index() { IMaterialService svc = new MaterialService(); var model = svc.GetAll(); return(View("~/Views/Master/Material/Index.cshtml", model)); }
public TrapDetails(User user, int trapID, bool readOnly) : base(user, "Trap:" + trapID) { InitializeComponent(); var service = new MaterialService(user); var model = service.GetTrap(trapID); var viewModel = new TrapViewModel(model); IsReadOnly = readOnly; this.DataContext = viewModel; viewModel.DataChanged += new DataChangedHandler(viewModel_DataChanged); txtTrapType.BindUser(User, PickListType.Phrase, "Trap Type", TraitCategoryType.Trap); tabTrap.AddTabItem("Traits", new TraitControl(User, TraitCategoryType.Trap, viewModel) { IsReadOnly = readOnly }); tabTrap.AddTabItem("Notes", new NotesControl(User, TraitCategoryType.Trap, viewModel) { IsReadOnly = readOnly }); tabTrap.AddTabItem("Ownership", new OwnershipDetails(model)); }
public useradminController(IAccountRepository _rightRepository, IDataCenterRepository _datacenterRepository, IMaterialRepository _materialRepository, ICostanalysisRepository _costanalysisRepository) { accountService = new AccountService(_rightRepository); centerService = new DataCenterService(_datacenterRepository); materialService = new MaterialService(_materialRepository); costanalysisService = new CostanalysisService(_costanalysisRepository); }
public HomeController(IDataCenterRepository _centerRepository, IMaterialRepository _materialRepository, IAccountRepository _rightRepository, IManagementRepository _managementRepository) { centerService = new DataCenterService(_centerRepository); accountService = new AccountService(_rightRepository); materialService = new MaterialService(_materialRepository); managementService = new ManagementService(_managementRepository); }
private void Bind() { stationNameText.DataBindings.Add("EditValue", m_station, "Name"); stationTypeSelList.DataBindings.Add("EditValue", m_station, "StationType"); allowRepairsCheck.DataBindings.Add("Checked", m_station, "AllowRepairs"); repairComponentsRequiredCheck.DataBindings.Add("Checked", m_station, "IsRepairComponentsRequired"); documentsGrid.DataSource = m_station.Documents; routeConfigLookUp.Properties.DataSource = Scout.Core.Service <IShopfloorService>().GetAllRouteConfigurations(m_unitOfWork); bomConfigurationLookup.DataSource = MaterialService.GetStationBomConfigurations(m_unitOfWork, m_station.Shopfloorline); Tasks = Scout.Core.Service <IShopfloorService>().GetStationMaterialTasks(m_unitOfWork, m_station); validationTypeLookup.DataSource = Enum.GetValues(typeof(StepResultValidationType)); }
public materialController(IMaterialRepository _materialRepository, ICostanalysisRepository _costanalysisRepository,IManagementRepository _managementRepository) { materialService = new MaterialService(_materialRepository); costanalysisService = new CostanalysisService(_costanalysisRepository); managementService = new ManagementService(_managementRepository); }
public costanalysisController(IMaterialRepository _materialRepository, ICostanalysisRepository _costanalysisRepository) { materialService = new MaterialService(_materialRepository); costanalysisService = new CostanalysisService(_costanalysisRepository); }