Пример #1
0
        private void ItemInventory_Load(object sender, EventArgs e)
        {
            try
            {
                DataGridViewNumericUpDownColumn colQtyInHand = new DataGridViewNumericUpDownColumn();
                colQtyInHand.HeaderText = "QtyInHand";
                colQtyInHand.HeaderCell.Style = dataGridViewItems.ColumnHeadersDefaultCellStyle;
                colQtyInHand.DefaultCellStyle = dataGridViewItems.DefaultCellStyle;
                colQtyInHand.ThousandsSeparator = true;

                var screenFunctions = CommonMethods.GetScreenFunctionsByScreen("INVENTORY", Common.Screens);

                if (!screenFunctions.Save)
                {
                    buttonSave.Visible = false;
                    colQtyInHand.ReadOnly = true;
                }

                dataGridViewItems.Columns.Add(colQtyInHand);

                int i = 0;
                ItemList.ForEach(delegate(ItemBO item)
                {
                    dataGridViewItems.Rows.Add(new DataGridViewRow());

                    dataGridViewItems.Rows[i].Cells[0].Value = item.ItemID.ToString();
                    dataGridViewItems.Rows[i].Cells[1].Value = item.ItemSerial.ToString();
                    dataGridViewItems.Rows[i].Cells[2].Value = item.Description.ToString();
                    dataGridViewItems.Rows[i].Cells[3].Value = item.BreakEven.ToString();
                    dataGridViewItems.Rows[i].Cells[4].Value = item.QtyInHand.ToString();

                    i++;
                });
            }
            catch
            {
                MessageBoxClass.ShowMessage(CommonMethods.GetError("U_007"), true);
            }
        }
Пример #2
0
        private void SubItem_Load(object sender, EventArgs e)
        {
            ScreenFunctions = CommonMethods.GetScreenFunctionsByScreen("MANAGESUBITEM", Common.Screens);

            if (!ScreenFunctions.Delete)
            {
                buttonDelete.Visible = false;
            }
            if (!ScreenFunctions.Save)
            {
                buttonSave.Visible = false;
            }
            WindowState = FormWindowState.Maximized;

            DataGridViewNumericUpDownColumn colNu = new DataGridViewNumericUpDownColumn();
            colNu.HeaderText = "Qty Allocated (per Unit)";
            colNu.DataPropertyName = "QtyForUnit";
            colNu.Name = "qtyInhand";
            colNu.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            colNu.HeaderCell.Style = dataGridViewSubItemDetails.ColumnHeadersDefaultCellStyle;
            colNu.DefaultCellStyle = dataGridViewSubItemDetails.DefaultCellStyle;
            colNu.ReadOnly = false;
            dataGridViewSubItemDetails.Columns.Add(colNu);
        }