Exemple #1
0
        private void addDataForUpdate()
        {
            StoreCell c = query.queryFindStoreCellById(Id);

            if (c == null)
            {
                return;
            }

            textBox2.Text = c.Description;
            ObjectComboBox obj = (ObjectComboBox)comboBoxStorages.SelectedItem;

            comboBoxStorages.SelectedValue = c.StorehouseId;
        }
Exemple #2
0
    public void SetItems(IEnumerable items)
    {
        storeCells.Clear();
        int num = 0;

        foreach (Item childItem in items)
        {
            if (!StoreManager.IsItemPrice(childItem.GetID()))
            {
                continue;
            }
            Vector3    pos      = new Vector3(transform.position.x, transform.position.y - (num + 0.5f) * Height, 0);
            GameObject instance = Instantiate(content, pos, transform.rotation, transform);
            instance.SetActive(true);
            StoreCell cell = instance.GetComponent <StoreCell>();
            cell.SetItem(childItem);
            storeCells.Add(cell);
            num += 1;
        }
    }
Exemple #3
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            StoreCell      c   = new StoreCell();
            ObjectComboBox obj = (ObjectComboBox)comboBoxStorages.SelectedItem;

            c.StorehouseId = obj.Id;
            c.Description  = textBox2.Text;
            if (Id == -1)
            {
                query.queryAddStoreCell(c);
            }
            else
            {
                c.Id = Id;
                query.queryUpdateStoreCell(c);
            }

            instance.refreshGrid();
            this.Dispose();
        }