private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         BS_MasterDataService.SupplierInfo supplierInfo = new BS_MasterDataService.SupplierInfo();
         supplierInfo.Address       = txtAddress.Text;
         supplierInfo.IsManufacture = (bool)chkIsManufacture.IsChecked;
         supplierInfo.Phone         = txtPhone.Text;
         supplierInfo.Pincode       = txtPincode.Text;
         supplierInfo.State         = txtState.Text;
         supplierInfo.SupplierID    = _supplierID;
         supplierInfo.SupplierName  = txtSupplierName.Text;
         supplierInfo.TIN           = txtTIN.Text;
         BLL.MasterDataBLL.InsertOrUpdateSupplierInfo(supplierInfo);
         List <BS_MasterDataService.SupplierInfo> suppierList = BLL.MasterDataBLL.GetSupplierInfo(pagerInfo);
         supplierGrid.ItemsSource = null;
         supplierGrid.ItemsSource = suppierList;
         txtAddress.Text          = string.Empty;
         txtPhone.Text            = string.Empty;
         txtPincode.Text          = string.Empty;
         txtSupplierName.Text     = string.Empty;
         txtTIN.Text   = string.Empty;
         txtState.Text = string.Empty;
         chkIsManufacture.IsChecked = false;
         _supplierID = 0;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
示例#2
0
 private void autoManufactureName_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     BS_MasterDataService.SupplierInfo supplierInfo = (BS_MasterDataService.SupplierInfo)autoManufactureName.SelectedItem;
     if (supplierInfo != null)
     {
         autoManufactureName.Text = supplierInfo.SupplierName;
     }
 }
 private void editButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         BS_MasterDataService.SupplierInfo supplierInfo = supplierGrid.SelectedItem as BS_MasterDataService.SupplierInfo;
         if (supplierInfo != null)
         {
             txtAddress.Text      = supplierInfo.Address;
             txtPhone.Text        = supplierInfo.Phone;
             txtPincode.Text      = supplierInfo.Pincode;
             txtState.Text        = supplierInfo.State;
             txtSupplierName.Text = supplierInfo.SupplierName;
             txtTIN.Text          = supplierInfo.TIN;
             _supplierID          = supplierInfo.SupplierID;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
示例#4
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());
            }
        }