コード例 #1
0
        void verify_Button_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var productCategoryDbutils = new ProductCategoryDbUtils();
            var productCategory        = new ProductCategory();

            productCategory.setCategoryCode(categoryid_Textbox.Text);

            if (productCategoryDbutils.getCategoryByCode(productCategory) == false)
            {
                var createCategory = new CreateCategory();
                createCategory.Show();
                MessageBox.Show("Category not exist! Create category");
            }
            else
            {
                productCategory          = productCategoryDbutils.getProductCategory(categoryid_Textbox.Text);
                description_Summary.Text = productCategory.getCategoryDescription();
                type_Summary.Text        = productCategory.getCategoryType();

                supplier_Summary.Text   = firstname_Textbox.Text + " " + lastname_Textbox.Text;
                contact_Summary.Text    = contact_Textbox.Text;
                code_Summary.Text       = code_Textbox.Text;
                name_Summary.Text       = name_Textbox.Text;
                brand_Summary.Text      = name_Textbox.Text;
                quantity_Summary.Text   = quantity_Textbox.Text;
                price_Summary.Text      = price_Textbox.Text;
                categoryid_Summary.Text = categoryid_Textbox.Text;
            }
        }
        void search_Button_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var productDbUtils1        = new ProductDbUtils();
            var productDbUtils2        = new ProductDbUtils();
            var productCategoryDbUtils = new ProductCategoryDbUtils();

            if (productcode_Textbox.Text == "")
            {
                MessageBox.Show("Dont leave empty!");
            }
            else
            {
                if (productDbUtils1.getProductByCode(productcode_Textbox.Text) == true)
                {
                    product         = new Product();
                    productCategory = new ProductCategory();
                    product         = productDbUtils2.getProduct(productcode_Textbox.Text);
                    productCategory = productCategoryDbUtils.getProductCategory(product.getProductCategoryCode());

                    costumer_Reciept.Text    = firstname_TextBox.Text + " " + lastname_TextBox.Text;
                    contact_Reciept.Text     = contact_Textbox.Text;
                    name_Reciept.Text        = product.getProductName();
                    brand_Reciept.Text       = product.getProductBrand();
                    description_Reciept.Text = productCategory.getCategoryDescription();
                    type_Reciept.Text        = productCategory.getCategoryType();
                    price_Reciept.Text       = product.getProductPrice().ToString();
                }
                else
                {
                    MessageBox.Show("No Product found!");
                }
            }
        }
コード例 #3
0
        public CategoryOpWindow(String catCode)
        {
            productCat        = new ProductCategory();
            productCatDbutils = new ProductCategoryDbUtils();

            InitializeComponent();
            this.catCode      = catCode;
            code_Textbox.Text = this.catCode;

            productCat = productCatDbutils.getProductCategory(this.catCode);
            Description_Textbox.Text = productCat.getCategoryDescription();
            type_Textbox.Text        = productCat.getCategoryType();
        }