当前位置: 首页>>代码示例>>C#>>正文


C# Product.SearchInformation方法代码示例

本文整理汇总了C#中Product.SearchInformation方法的典型用法代码示例。如果您正苦于以下问题:C# Product.SearchInformation方法的具体用法?C# Product.SearchInformation怎么用?C# Product.SearchInformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Product的用法示例。


在下文中一共展示了Product.SearchInformation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            bool valid = false;
            if (Validator.IsNumeric(textBoxCheck))
            {
                //calulate total quantity
                if (radioButtonCheckin.Checked)
                {
                    total = Int32.Parse(textBoxCheck.Text) + Int32.Parse(textBoxQoh.Text);
                    valid = true;
                }
                else if (radioButtonCheckout.Checked)
                {
                    int qoh=Int32.Parse(textBoxQoh.Text);
                    int checkout=Int32.Parse(textBoxCheck.Text);
                    if (qoh>=checkout)
                    {
                        total = qoh - checkout;
                        valid = true;
                    }
                    else
                    {
                        MessageBox.Show("Quantity On Hand is not enough to checkout.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                if (valid)
                {
                     //update product quantity
                    List<Product> listOfProduct = null;
                    if (comboBoxType.Text == "Book")
                    {
                        Product searchProduct = new Product("", comboBoxName.Text, 0, "", "", "");
                        listOfProduct = searchProduct.SearchInformation(searchProduct);
                        foreach (var item in listOfProduct)
                        {
                            if (item.ProductId.Substring(0, 1) == "B")
                            {
                                Product newItem = item;
                                newItem.Qoh = total;
                                newItem.UpdateInformation(item,newItem);
                                textBoxQoh.Text = total.ToString();
                                textBoxCheck.Text = "";
                            }
                        }
                    }
                    else if (comboBoxType.Text == "Software")
                    {
                        Product searchProduct = new Product("", comboBoxName.Text, 0, "", "", "");
                        listOfProduct = searchProduct.SearchInformation(searchProduct);
                        foreach (var item in listOfProduct)
                        {
                            if (item.ProductId.Substring(0, 1) == "S")
                            {
                                Product newItem = item;
                                newItem.Qoh = total;
                                newItem.UpdateInformation(item, newItem);
                                textBoxQoh.Text = total.ToString();
                                textBoxCheck.Text = "";
                            }
                        }
                    }
                }

            }
        }
开发者ID:mrmontreal,项目名称:works,代码行数:65,代码来源:ModProductInventory.cs

示例2: comboBoxName_SelectedIndexChanged

        private void comboBoxName_SelectedIndexChanged(object sender, EventArgs e)
        {
            //read qoh from a product
            textBoxQoh.Text = "";
            List<Product> listOfProduct=null;
            if (comboBoxType.Text == "Book")
            {
                Product searchProduct = new Product("", comboBoxName.Text, 0, "", "", "");
                listOfProduct = searchProduct.SearchInformation(searchProduct);
                foreach (var item in listOfProduct)
                {
                    if (item.ProductId.Substring(0, 1) == "B")
                    {
                        textBoxQoh.Text = item.Qoh.ToString();
                    }
                }
            }
            else if (comboBoxType.Text == "Software")
            {
                Product searchProduct = new Product("", comboBoxName.Text, 0, "", "", "");
                listOfProduct = searchProduct.SearchInformation(searchProduct);
                foreach (var item in listOfProduct)
                {
                    if (item.ProductId.Substring(0, 1) == "S")
                    {
                        textBoxQoh.Text = item.Qoh.ToString();
                    }
                }

            }
        }
开发者ID:mrmontreal,项目名称:works,代码行数:31,代码来源:ModProductInventory.cs


注:本文中的Product.SearchInformation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。