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);
                    }
                }
            }
        }
Example #3
0
 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;
 }
Example #4
0
 public ShelfViewModel()
 {
     Shelf = new Shelf();
     LoadMetod();
     SaveCommand = new RelayCommand(SaveAction, CanSave);
     LoadCommand = new RelayCommand(LoadAction, CanLoad);
 }
Example #5
0
        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);
            }
        }
Example #6
0
        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());
        }
Example #7
0
 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();
            }
        }
Example #9
0
    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;
     */
 }
Example #11
0
 public virtual void CreateShelf(Shelf entity)
 {
     entityDao.CreateShelf(entity);
 }
Example #12
0
 /// <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);
 }
Example #13
0
	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 ();
	}
Example #14
0
 public void DeleteShelf(Shelf shelf)
 {
     ShelfMgr.DeleteShelf(shelf);
 }
Example #15
0
 public void CreateShelf(Shelf shelf)
 {
     ShelfMgr.CreateShelf(shelf);
 }
Example #16
0
 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;
 }
Example #17
0
 public void UpdateShelf(Shelf shelf)
 {
     ShelfMgr.UpdateShelf(shelf);
 }
Example #18
0
			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;
			}
Example #19
0
		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;
		}
Example #20
0
        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);
        }
Example #21
0
 public virtual void DeleteShelf(Shelf entity)
 {
     entityDao.DeleteShelf(entity);
 }
Example #22
0
 public virtual void CreateShelf(Shelf entity)
 {
     Create(entity);
 }
Example #23
0
 public virtual void DeleteShelf(Shelf entity)
 {
     Delete(entity);
 }
Example #24
0
 public virtual void UpdateShelf(Shelf entity)
 {
     Update(entity);
 }
Example #25
0
 public virtual void UpdateShelf(Shelf entity)
 {
     entityDao.UpdateShelf(entity);
 }
Example #26
0
			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);
			}