Пример #1
0
        private void LoadInventory()
        {
            BSInventoryItem bs = new BSInventoryItem();
            item = bs.getInventoryItem(this.item.ItemId);

            if (item != null)
            {
                txtItemName.Text = item.ItemName;
                txtCategory.Text = item.CategoryName;
                txtQuantity.Text = item.Quantity.ToString();
                txtPrice.Text = item.Price.ToString();
                txtAvailable.Text = item.Available;
                txtRemarks.Text = item.Remarks;
                lblCreated.Text = item.CreatedByName + " at " + String.Format("{0:MMMM dd, yyyy}", item.CreatedDate) + " " + String.Format("{0:HH:MM:sstt}", item.CreatedDate);

                if (String.IsNullOrEmpty(item.ModifiedByName))
                {
                    lblModified.Visible = false;
                    lblTitleCreatedBy.Visible = false;
                }
                else
                {
                    lblModified.Visible = true;
                    lblTitleCreatedBy.Visible = true;
                    lblModified.Text = item.ModifiedByName + " at " + String.Format("{0:MMMM dd, yyyy}", item.ModifiedDate) + " " + String.Format("{0:HH:MM:sstt}", item.ModifiedDate);
                }
            }
        }
Пример #2
0
        private void LoadInventory()
        {
            BSInventoryItem bs = new BSInventoryItem();
            List<InventoryItem> itemlist = new List<InventoryItem>();
            InventoryItem s = new InventoryItem();

            DataGridViewLinkColumn Editlink = new DataGridViewLinkColumn();
            Editlink.UseColumnTextForLinkValue = true;
            Editlink.HeaderText = "";
            Editlink.DataPropertyName = "lnkColumn";
            Editlink.LinkBehavior = LinkBehavior.SystemDefault;
            Editlink.Text = "Edit";
            dgvData.Columns.Add(Editlink);

            DataGridViewLinkColumn Deletelink = new DataGridViewLinkColumn();
            Deletelink.UseColumnTextForLinkValue = true;
            Deletelink.HeaderText = "";
            Deletelink.DataPropertyName = "lnkColumn";
            Deletelink.LinkBehavior = LinkBehavior.SystemDefault;
            Deletelink.Text = "Delete";
            dgvData.Columns.Add(Deletelink);

            itemlist = bs.getInventoryItem(0, 0);
            dgvData.DataSource = null;
            dgvData.Rows.Clear();
            dgvData.Columns.Clear();
            dgvData.Refresh();
            dgvData.DataSource = itemlist;

            for (int i = 0; i < dgvData.ColumnCount; i++)
            {
                if (dgvData.Columns[i].HeaderText.ToUpper() == VJColumnName.CONST_ITEM_ID.ToUpper() ||
                    dgvData.Columns[i].HeaderText.ToUpper() == VJColumnName.CONST_CATEGORY_ID.ToUpper()||
                    dgvData.Columns[i].HeaderText.ToUpper() == VJColumnName.CONST_CREATED_BY.ToUpper()||
                    dgvData.Columns[i].HeaderText.ToUpper() == VJColumnName.CONST_MODIFIED_BY.ToUpper())
                {
                    dgvData.Columns[i].Visible = false;
                }
            }
        }
        private void LoadInventoryItem(int itemid)
        {
            BSInventoryItem bs = new BSInventoryItem();
            InventoryItem data = new InventoryItem();

            data = bs.getInventoryItem(itemid);

            if (data != null)
            {
                txtItemName.Text = data.ItemName;
                cmbCategory.SelectedValue = data.CategoryId;
                cmbAvailable.SelectedValue = data.Available;
                npdQuantity.Value = data.Quantity;
                txtPrice.Text = data.Price.ToString();
                txtRemarks.Text = data.Remarks;
            }
        }