예제 #1
0
        void ButtonAddClick(object sender, EventArgs e)
        {
            using (PhysicalCountItemForm f = new PhysicalCountItemForm()) {
                if (WorkbenchSingleton.AddDialog(f) == DialogResult.OK)
                {
                    PhysicalCountItem i = GetInDetails(f.Item);
                    if (i != null)
                    {
                        i.AdjustedQty += f.Item.AdjustedQty;
                    }
                    else
                    {
                        count.AddItem(f.Item);
                    }
                    RefreshList();

                    PhysicalCountItem i3 = f.Item;
                    if (i3.Item.IsFullCase())
                    {
                        using (PhysicalCountItemForm f2 = new PhysicalCountItemForm()) {
                            string suggestedCode = ItemSuggestionUtility.Suggest(i3.Item.Name.ToUpper().Replace("FC-", "MT-"));
                            f2.FindCode(suggestedCode, i3.AdjustedQty);
                            if (WorkbenchSingleton.AddDialog(f2) == DialogResult.OK)
                            {
                                PhysicalCountItem i2 = GetInDetails(f2.Item);
                                if (i2 != null)
                                {
                                    i2.AdjustedQty += f2.Item.AdjustedQty;
                                }
                                else
                                {
                                    count.AddItem(f2.Item);
                                }
                                RefreshList();
                            }
                        }
                    }
                    else if (i3.Item.IsSMBFullCase())
                    {
                        using (PhysicalCountItemForm f2 = new PhysicalCountItemForm()) {
                            string suggestedCode = ItemSuggestionUtility.Suggest(i3.Item.Name.ToUpper().Replace("SMBFC-", "SMBMT-"));
                            f2.FindCode(suggestedCode, i3.AdjustedQty);
                            if (WorkbenchSingleton.AddDialog(f2) == DialogResult.OK)
                            {
                                PhysicalCountItem i2 = GetInDetails(f2.Item);
                                if (i2 != null)
                                {
                                    i2.AdjustedQty += f2.Item.AdjustedQty;
                                }
                                else
                                {
                                    count.AddItem(f2.Item);
                                }
                                RefreshList();
                            }
                        }
                    }
                }
            }
        }
예제 #2
0
 void ListView1DoubleClick(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         PhysicalCountItem item = count.Items[listView1.SelectedItems[0].Index];
         using (PhysicalCountItemForm f = new PhysicalCountItemForm(item)) {
             if (WorkbenchSingleton.AddDialog(f) == DialogResult.OK)
             {
                 RefreshList();
             }
         }
     }
 }