コード例 #1
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     txtProductName.Text               = string.Empty;
     autoManufactureName.Text          = string.Empty;
     autoCategoryName.Text             = string.Empty;
     chkIsGiftItem.IsChecked           = false;
     chkIsTaxable.IsChecked            = false;
     chkDifferentRateForSize.IsChecked = false;
     _productInfo = null;
 }
コード例 #2
0
        private void editButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                _productInfo = productGrid.SelectedItem as BS_MasterDataService.ProductInfo;
                if (_productInfo != null)
                {
                    txtProductName.Text               = _productInfo.ProductDescription;
                    autoManufactureName.Text          = _productInfo.VendorInfo.SupplierName;
                    autoCategoryName.Text             = _productInfo.ProductCategoryInfo.CategoryName;
                    chkIsGiftItem.IsChecked           = _productInfo.IsGiftItem == 'Y' ? true : false;
                    chkIsTaxable.IsChecked            = _productInfo.IsTaxableItem == 'Y' ? true : false;
                    chkDifferentRateForSize.IsChecked = _productInfo.IsDifferentRateInSize == 'Y' ? true : false;

                    //   _supplierID = supplierInfo.SupplierID;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
コード例 #3
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                BS_MasterDataService.ProductInfo productInfo = new BS_MasterDataService.ProductInfo();
                if (_productInfo != null)
                {
                    productInfo.ProductCode = _productInfo.ProductCode;
                }

                productInfo.ProductDescription = txtProductName.Text;

                productInfo.IsGiftItem    = chkIsGiftItem.IsChecked == true ? 'Y' : 'N';
                productInfo.IsTaxableItem = chkIsTaxable.IsChecked == true ? 'Y' : 'N';
                BS_MasterDataService.SupplierInfo supplierInfo = (BS_MasterDataService.SupplierInfo)autoManufactureName.SelectedItem;
                if (supplierInfo != null)
                {
                    productInfo.VendorInfo = supplierInfo;
                }
                else
                {
                    productInfo.VendorInfo = _productInfo.VendorInfo;
                }

                CategoryInfo categoryInfo = (CategoryInfo)autoCategoryName.SelectedItem;
                if (categoryInfo != null)
                {
                    productInfo.ProductCategoryInfo = categoryInfo;
                }
                else
                {
                    productInfo.ProductCategoryInfo = _productInfo.ProductCategoryInfo;
                }

                if (txtProfit.Text.Trim().Length > 0)
                {
                    productInfo.ProfitPrecentage = Convert.ToDecimal(txtProfit.Text);
                }

                productInfo.IsDifferentRateInSize = chkDifferentRateForSize.IsChecked == true ? 'Y' : 'N';

                if (productInfo != null)
                {
                    if (BLL.MasterDataBLL.InsertOrUpdateProductInfo(productInfo))
                    {
                        List <BS_MasterDataService.ProductInfo> productList = BLL.MasterDataBLL.GetProductInfo(pagerInfo);
                        productGrid.ItemsSource           = productList;
                        txtProductName.Text               = string.Empty;
                        autoManufactureName.Text          = string.Empty;
                        autoCategoryName.Text             = string.Empty;
                        chkIsGiftItem.IsChecked           = false;
                        chkIsTaxable.IsChecked            = false;
                        chkDifferentRateForSize.IsChecked = false;
                        _productInfo = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }