예제 #1
0
 private void BtnEditItemShop_Click(object sender, EventArgs e)
 {
     foreach (ListViewItem item in lstPrintShop.SelectedItems)
     {
         var shopItem = (PrintShopItem)item.Tag;
         var dialog   = new FrmEditShopItem(shopItem);
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             continue;
         }
         item.Tag = dialog.ShopItem;
         item.SubItems[1].Text = dialog.ShopItem.Title;
         item.SubItems[2].Text = dialog.ShopItem.Media;
         item.SubItems[3].Text = dialog.ShopItem.QuantitySent.ToString();
         item.SubItems[4].Text = dialog.ShopItem.Price.ToString("C");
         item.SubItems[5].Text = dialog.ShopItem.LocationCode;
         item.SubItems[6].Text = dialog.ShopItem.Category;
     }
 }
예제 #2
0
 private void lstPrintShop_DoubleClick(object sender, EventArgs e)
 {
     if (lstPrintShop.SelectedItems.Count > 0)
     {
         var item     = lstPrintShop.SelectedItems[0];
         var shopItem = (PrintShopItem)item.Tag;
         var dialog   = new FrmEditShopItem(shopItem);
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         item.Tag = dialog.ShopItem;
         item.SubItems[1].Text = dialog.ShopItem.Title;
         item.SubItems[2].Text = dialog.ShopItem.Media;
         item.SubItems[3].Text = dialog.ShopItem.QuantitySent.ToString();
         item.SubItems[4].Text = dialog.ShopItem.Price.ToString("C");
         item.SubItems[5].Text = dialog.ShopItem.LocationCode;
         item.SubItems[6].Text = dialog.ShopItem.Category;
     }
 }
예제 #3
0
        private void BtnAddItemShop_Click(object sender, EventArgs e)
        {
            var dialog = new FrmEditShopItem(null, (int)Presence.ArtistAttendingID);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var item = new ListViewItem()
                {
                    Text = dialog.ShopItem.ShowNumber.ToString()
                };
                item.SubItems.Add(dialog.ShopItem.Title);
                item.SubItems.Add(dialog.ShopItem.Media);
                item.SubItems.Add(dialog.ShopItem.QuantitySent.ToString());
                item.SubItems.Add(Convert.ToSingle(dialog.ShopItem.Price).ToString("C"));
                item.SubItems.Add(dialog.ShopItem.LocationCode);
                item.SubItems.Add(dialog.ShopItem.Category);
                item.SubItems.Add("No");
                item.Tag = dialog.ShopItem;
                lstPrintShop.Items.Add(item);
            }
        }