private void gridBinLocationView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { DataRow dr = gridBinLocationView.GetFocusedDataRow(); if (dr != null) { int selected = Convert.ToInt32(dr["ID"]); Shelf slf = new Shelf(); slf.LoadByPrimaryKey(selected); if (slf.RowCount > 0) { txtShelf.Text = slf.ShelfCode; if (!slf.IsColumnNull("StoreID")) { cboStore.SelectedValue = slf.StoreID.ToString(); } if (!slf.IsColumnNull("ShelfStorageType")) { cboType.SelectedValue = slf.ShelfStorageType; } shelfId = slf.ID; } btnLocationsave.Text = "Update"; } }
/// <summary> /// Executes the command /// </summary> /// /// <param name="parameter"> /// The input from 'CommandParameter' /// </param> public void Execute(object parameter) { Shelf shelf = (parameter as Shelf); Shelf newShelf = (shelf.Clone() as Shelf); bool isValid = false; switch (shelf.ShelfTypeName) { case "Fixed": shelfTypeName = "Adjustable"; isValid = true; break; case "Corner (Fixed)": shelfTypeName = "Corner (Adj)"; isValid = true; break; } if (isValid) { foreach (var shelfType in viewmodel.ShelfTypes) { if (shelfType.Name == shelfTypeName) { newShelf.ShelfTypeName = shelfTypeName; viewmodel.Add(newShelf); } } } }
public MiniRefig(string name) { Name = name; numOfShelfs = 3; shelfContainer = new Shelf[] { new Shelf(1, 100, Size.Mini), new Shelf(2, 100, Size.Mini), new Shelf(3, 100, Size.Mini) }; fridgeSize = Size.Mini; }
public ShelfViewModel() { Shelf = new Shelf(); LoadMetod(); SaveCommand = new RelayCommand(SaveAction, CanSave); LoadCommand = new RelayCommand(LoadAction, CanLoad); }
private object GetEditObject() { if (this.ValidateInput()) { if (_shelfFacade == null) { _shelfFacade = new FacadeFactory(base.DataProvider).CreateShelfFacade(); } Shelf shelf = this._shelfFacade.CreateNewShelf(); shelf.ShelfNO = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtShelfNOEdit.Text, 6)); shelf.Status = ShelfStatus.BurnOut; shelf.Memo = FormatHelper.CleanString(this.txtMemoEdit.Text, 100); shelf.MaintainUser = this.GetUserCode(); return(shelf); } else { return(null); } }
public async Task <IActionResult> PutShelf(int id, Shelf shelf) { if (id != shelf.Id) { return(BadRequest()); } _context.Entry(shelf).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ShelfExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void Setup() { testShelf = new Shelf(); twixBar = new Candy("Twix", 1.99m, "Sweet", "Gold"); snickers = new Candy("Snickers", 0.99m, "Salty", "Brown"); almondJoy = new Candy("Almond Joy", 5.89m, "Sweet", "Blue"); }
private void ModifyToggleButtonClick(object sender, RoutedEventArgs e) { ToggleButton currentModifyToggleButton = (ToggleButton)sender; if (currentModifyToggleButton != lastModifyToggleButton && lastModifyToggleButton != null) { lastModifyToggleButton.IsChecked = false; } lastModifyToggleButton = (bool)currentModifyToggleButton.IsChecked ? currentModifyToggleButton : null; if (lastModifyToggleButton != null) { shelfToModify = (Shelf)ShelfsDataGrid.SelectedItem; AddButtonImage.Source = new BitmapImage(new Uri(@"Assets/Icons/modify.png", UriKind.Relative)); AddButtonTextBlock.Text = "Modyfikuj"; AddShelfTextBox.Text = shelfToModify.ShelfName; } else { shelfToModify = null; AddButtonImage.Source = new BitmapImage(new Uri(@"Assets/Icons/add.png", UriKind.Relative)); AddButtonTextBlock.Text = "Dodaj"; AddShelfTextBox.Clear(); } }
protected void ODS_Shelf_Inserting(object sender, ObjectDataSourceMethodEventArgs e) { Controls_TextBox tbProductLine = (Controls_TextBox)this.FV_Shelf.FindControl("tbProductLine"); TextBox tbCapacity = (TextBox)this.FV_Shelf.FindControl("tbCapacity"); shelf = (Shelf)e.InputParameters[0]; shelf.Code = shelf.Code.Trim(); shelf.ProductLine = TheFlowMgr.LoadFlow(tbProductLine.Text.Trim()); shelf.TagNo = shelf.TagNo.Trim(); }
public static IAsyncOperation ApplyShelf(Shelf s) { throw new NotImplementedException (); /* MessageDialogProgressMonitor monitor = new MessageDialogProgressMonitor (true, false, false, true); var statusTracker = IdeApp.Workspace.GetFileStatusTracker (); ThreadPool.QueueUserWorkItem (delegate { try { NGit.Api.MergeCommandResult result; using (var gm = new MercurialMonitor (monitor)) result = s.Apply (gm); ReportShelfResult (monitor, result); } catch (Exception ex) { string msg = GettextCatalog.GetString ("Stash operation failed."); monitor.ReportError (msg, ex); } finally { monitor.Dispose (); statusTracker.NotifyChanges (); } }); return monitor.AsyncOperation; */ }
public virtual void CreateShelf(Shelf entity) { entityDao.CreateShelf(entity); }
/// <summary> /// Creates a new view for the specified <see cref="Shelf"/>. /// </summary> /// <remarks> /// Override this method if you want to return a custom implementation of <see cref="IShelfView"/>. /// In practice, it is preferable to subclass <see cref="ShelfView"/> rather than implement <see cref="IShelfView"/> /// directly. /// </remarks> /// <param name="shelf"></param> /// <returns></returns> public virtual IShelfView CreateShelfView(Shelf shelf) { return new ShelfView(shelf, this); }
void JSONParse(){ var N = JSONNode.Parse(JSONString); Debug.Log (JSONString); for(int i = 0; i< N.Count; i++){ //Fixture Fixture f = new Fixture(); f.z = int.Parse(N[i]["z"]); f.width = int.Parse(N[i]["width"]); f.height = int.Parse(N[i]["height"]); f.depth = int.Parse(N[i]["depth"]); f.categoryId = int.Parse(N[i]["categoryId"]); f.categoryName = N[i]["categoryName"]; GameObject fixtureObject = Instantiate(fixturePrefab, this.transform.position, this.transform.rotation) as GameObject; FixtureItem fI = fixtureObject.GetComponent<FixtureItem>(); fI.categoryId = f.categoryId; fI.width = f.width; fI.height = f.height; fI.depth = f.depth; fI.categoryName = f.categoryName; fI.z = f.z; fI.id = i; FixturesList.Add(fixtureObject); //Shelves var shelves = N[i]["shelfs"]; for(int j = 0; j< shelves.Count; j++){ Shelf s = new Shelf(); s.height = int.Parse(N[i]["shelfs"][j]["height"]); s.shelfId = int.Parse(N[i]["shelfs"][j]["shelfId"]); GameObject shelfObject = Instantiate(shelfPrefab, this.transform.position, this.transform.rotation) as GameObject; fI.shelves.Add(shelfObject); shelfObject.transform.SetParent(fI.shelvesParent.transform); ShelfItem sI = shelfObject.transform.FindChild("Shelf").gameObject.GetComponent<ShelfItem>(); sI.width = f.width; sI.depth = f.depth; sI.height = s.height; sI.positionId = j; sI.shelfId = s.shelfId; sI.id = j; if(j>0){ fI.shelveHeightOffset += fI.shelves[j-1].gameObject.transform.FindChild("Shelf").gameObject.GetComponent<ShelfItem>().height + thickness; sI.positionY = fI.shelveHeightOffset; } sI.PositionShelf(); //Products var products = N[i]["shelfs"][j]["products"]; //Product Groups for(int p = 0 ; p < products.Count; p++){ ProductGroup prodGroup = new ProductGroup(); prodGroup.productId = int.Parse(N[i]["shelfs"][j]["products"][p]["productId"]); prodGroup.productName = N[i]["shelfs"][j]["products"][p]["productName"]; prodGroup.horizontalFacing = int.Parse(N[i]["shelfs"][j]["products"][p]["horizontalFacing"]); prodGroup.verticalFacing = int.Parse(N[i]["shelfs"][j]["products"][p]["verticalFacing"]); GameObject productGroup = Instantiate(productGroupPrefab, sI.transform.position, sI.transform.rotation) as GameObject; sI.productGroups.Add(productGroup); productGroup.transform.SetParent(sI.transform.parent); productGroup.name = "PG " + p; ProductGroupItem pgI = productGroup.GetComponent<ProductGroupItem>(); pgI.productId = prodGroup.productId; pgI.horizontalFacing = prodGroup.horizontalFacing; pgI.verticalFacing = prodGroup.verticalFacing; pgI.productName = prodGroup.productName; pgI.shelf = sI.GetComponent<ShelfItem>(); //Products int productsNumber = pgI.horizontalFacing * pgI.verticalFacing; for(int pp = 0; pp < productsNumber; pp++){ Product prod = new Product(); prod.productId = int.Parse(N[i]["shelfs"][j]["products"][p]["productId"]); prod.productName = N[i]["shelfs"][j]["products"][p]["productName"]; prod.width = int.Parse(N[i]["shelfs"][j]["products"][p]["width"]); prod.height = int.Parse(N[i]["shelfs"][j]["products"][p]["height"]); prod.depth = int.Parse(N[i]["shelfs"][j]["products"][p]["depth"]); prod.image = N[i]["shelfs"][j]["products"][p]["image"]; prod.color = N[i]["shelfs"][j]["products"][p]["color"]; GameObject productObject = Instantiate(productPrefab, sI.transform.position, sI.transform.rotation) as GameObject; pgI.groupedProducts.Add(productObject); productObject.transform.SetParent(productGroup.transform); ProductItem pI = productObject.GetComponent<ProductItem>(); pI.name = "product_" + pp.ToString() + "_shelf_" + p; pI.productId = prod.productId; pI.image = prod.image; pI.color = prod.color; pI.productName = prod.productName; pI.productParent = sI.transform.parent.gameObject; pI.productShelf = sI.gameObject; pI.width = prod.width; pI.height = prod.height; pI.depth = prod.depth; //Add VRData functionality #region VRData_init //make sure the vr data kit is set up pI.gameObject.AddComponent <VRInteractiveItem> (); pI.gameObject.AddComponent <InteractiveSceneItem> (); //get interactive shelf item script InteractiveSceneItem shelfItemIA = pI.gameObject.GetComponent <InteractiveSceneItem> (); //fill interactive shelf item params VRInteractiveItem vrItem = pI.gameObject.GetComponent <VRInteractiveItem> (); Renderer itemRenderer = pI.gameObject.GetComponent <Renderer> (); shelfItemIA.m_InteractiveItem = vrItem; shelfItemIA.m_Renderer = itemRenderer; #endregion VRData_init } } //End of Products } //End of Shelves //End of Fixture //Cap Shelve GameObject shelfObjectCap = Instantiate(shelfPrefab, this.transform.position, this.transform.rotation) as GameObject; fI.shelves.Add(shelfObjectCap); shelfObjectCap.transform.SetParent(fI.shelvesParent.transform); ShelfItem sII = shelfObjectCap.transform.FindChild("Shelf").gameObject.GetComponent<ShelfItem>(); sII.width = f.width; sII.depth = f.depth; shelfObjectCap.gameObject.name = "Cap"; sII.PositionShelf(); shelfObjectCap.transform.position = new Vector3(0.0f, fI.height/100.0f - (thickness), sII.transform.position.z); } PositionFixtures (); }
public void DeleteShelf(Shelf shelf) { ShelfMgr.DeleteShelf(shelf); }
public void CreateShelf(Shelf shelf) { ShelfMgr.CreateShelf(shelf); }
private void UpdateView(Shelf shelf) { Controls_TextBox tbProductLine = (Controls_TextBox)this.FV_Shelf.FindControl("tbProductLine"); tbProductLine.ServiceParameter = "string:" + this.CurrentUser.Code + ",bool:true"; tbProductLine.DataBind(); tbProductLine.Text = shelf.ProductLine.Code; }
public void UpdateShelf(Shelf shelf) { ShelfMgr.UpdateShelf(shelf); }
public static Shelf FromXmlElement(XmlElement element) { Platform.CheckTrue(element.Name == "shelf", "The settings xml is invalid."); string name = element.GetAttribute("name"); XmlElement restoreElement = (XmlElement) element["restore-document"].FirstChild; XmlDocument restoreDocument = new XmlDocument(); restoreDocument.AppendChild(restoreDocument.ImportNode(restoreElement, true)); Shelf shelf = new Shelf(name); shelf.RestoreDocument = restoreDocument; return shelf; }
public void SaveShelfState(string desktopWindowName, string shelfName, XmlDocument restoreDocument) { if (String.IsNullOrEmpty(shelfName)) return; desktopWindowName = desktopWindowName ?? ""; Initialize(); DesktopWindow window = _currentDesktop.GetDesktopWindow(desktopWindowName); if (window == null) { window = new DesktopWindow(desktopWindowName); _currentDesktop.AddDesktopWindow(window); } Shelf shelf = window.GetShelf(shelfName); if (shelf == null) { shelf = new Shelf(shelfName); window.AddShelf(shelf); } shelf.RestoreDocument = restoreDocument; }
private void ProcessShelfIn(MesScmsTableIndex mesScmsTableIndex) { #region ����� IList<MesScmsStationShelf> mesScmsStationShelfList = mesScmsStationShelfMgr.GetUpdateMesScmsStationShelf(); if (mesScmsStationShelfList != null && mesScmsStationShelfList.Count > 0) { foreach (MesScmsStationShelf mesScmsStationShelf in mesScmsStationShelfList) { if (mesScmsStationShelf.Flag == MesDssConstants.MES_SCMS_FLAG_FTPC_UPDATED) { Shelf shelf = shelfMgr.LoadShelf(mesScmsStationShelf.ShelfNo); if (shelf == null) { shelf = new Shelf(); shelf.Code = mesScmsStationShelf.ShelfNo; Flow flow = flowMgr.LoadFlowByDesc(mesScmsStationShelf.LineName); if (flow == null) { log.Error(mesScmsStationShelf.LineName + " not found "); continue; } shelf.ProductLine = flow; shelf.IsActive = true; shelf.Capacity = mesScmsStationShelf.Qty; shelf.TagNo = mesScmsStationShelf.StationName; shelfMgr.CreateShelf(shelf); } else { Flow flow = flowMgr.LoadFlow(mesScmsStationShelf.LineName); if (flow == null) { log.Error(mesScmsStationShelf.LineName + " not found "); continue; } shelf.ProductLine = flow; shelf.IsActive = true; shelf.Capacity = mesScmsStationShelf.Qty; shelf.TagNo = mesScmsStationShelf.StationName; shelfMgr.UpdateShelf(shelf); } } else if (mesScmsStationShelf.Flag == MesDssConstants.MES_SCMS_FLAG_FTPC_DELETED) { try { Shelf shelf = shelfMgr.LoadShelf(mesScmsStationShelf.ShelfNo); if (shelf != null) { shelf.IsActive = false; shelfMgr.UpdateShelf(shelf); } } catch (Exception e) { this.CleanSession(); log.Error(mesScmsStationShelf.ShelfNo + " delete exception", e); continue; } } try { mesScmsStationShelfMgr.Complete(mesScmsStationShelf); } catch (Exception e) { this.CleanSession(); log.Error(mesScmsStationShelf.ShelfNo + " complete exception", e); continue; } } } #endregion mesScmsTableIndexMgr.Complete(mesScmsTableIndex); }
public virtual void DeleteShelf(Shelf entity) { entityDao.DeleteShelf(entity); }
public virtual void CreateShelf(Shelf entity) { Create(entity); }
public virtual void DeleteShelf(Shelf entity) { Delete(entity); }
public virtual void UpdateShelf(Shelf entity) { Update(entity); }
public virtual void UpdateShelf(Shelf entity) { entityDao.UpdateShelf(entity); }
public void AddShelf(Shelf shelf) { Shelf existing = _shelves.Find(delegate(Shelf test) { return test.Name == shelf.Name; }); if (existing != null) throw new InvalidOperationException("A shelf with the specified name already exists."); _shelves.Add(shelf); }