private void btn_save_click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(product_name.Text) || string.IsNullOrEmpty(retail_price.Text) || string.IsNullOrEmpty(trade_price.Text) || string.IsNullOrEmpty(itemType.Text) || item_Type.SelectedIndex == -1) { // msg = "Please fill the required fields first"; ConfirmationPopup form = new ConfirmationPopup((string)Application.Current.Resources["error_message_Tax"], header, false); form.ShowDialog(); } else if (is_texinclusive.IsChecked.Value == false && string.IsNullOrEmpty(taxPercentage_.Text)) { ConfirmationPopup form = new ConfirmationPopup((string)Application.Current.Resources["taxPercentage_ErrorMsg"], header, false); form.ShowDialog(); } else { decimal?nullval = null; int? integernull = null; if (!string.IsNullOrEmpty(category_code.Text)) { categoryId = _categories.FirstOrDefault(x => x.CategoryName.ToLower() == category_code.Text.ToLower()).Id; } //binaryImage = Utility.CommonMethods.CommonFunctions.ImageToByteArray((BitmapImage)CompanyLogo.Source); //string data = Convert.ToBase64String(binaryImage); ProductModel model = new ProductModel(0, product_name.Text, categoryId, string.IsNullOrEmpty(retail_price.Text) ? nullval : Convert.ToDecimal(retail_price.Text), string.IsNullOrEmpty(trade_price.Text) ? nullval : Convert.ToDecimal(trade_price.Text), string.IsNullOrEmpty(wholeseller_price.Text) ? nullval : Convert.ToDecimal(wholeseller_price.Text), string.IsNullOrEmpty(reseller_price.Text) ? nullval : Convert.ToDecimal(reseller_price.Text), Convert.ToInt32(item_Type.SelectedItem), string.IsNullOrEmpty(weight_.Text) ? nullval : Convert.ToDecimal(weight_.Text), barcode_.Text, string.IsNullOrEmpty(taxPercentage_.Text) ? nullval : Convert.ToDecimal(taxPercentage_.Text), string.IsNullOrEmpty(minimum_level.Text) ? integernull : Convert.ToInt32(minimum_level.Text), string.IsNullOrEmpty(reorder_level.Text) ? integernull : Convert.ToInt32(reorder_level.Text), null, is_texinclusive.IsChecked.Value, shortname_.Text, description_.Text, UserModelVm.BranchId, string.Empty, string.Empty, null, CompanyLogo.Source.ToString(), UserModelVm.CompanyId, null); int id = controller.SaveUpdateProduct(model); // msg = "Product saved successfully"; // ConfirmationPopup form = new ConfirmationPopup(msg, header, false); // form.ShowDialog(); Common.Notification((string)Application.Current.Resources["product_saveSuccessMsg"], header, false); ClearFields(); inventory form1 = new inventory(); NavigationService.Navigate(form1); } }
private void btn_back_click(object sender, RoutedEventArgs e) { ClearFields(); inventory form = new inventory(); NavigationService.Navigate(form); }
private void SuccessRetrun() { Common.Notification((string)Application.Current.Resources["product_saveSuccessMsg"], header, false); ClearFields(); inventory form1 = new inventory(); NavigationService.Navigate(form1); }
private void update_label_data(object sender, RoutedEventArgs e) { ProductController controller = new ProductController(); LabelSettingModel model = new LabelSettingModel(Id, lebelSettingCode, ItemId, print_item_code.IsChecked.Value, chk_item_detail.IsChecked.Value, "0", print_item_price.IsChecked.Value, chk_print_barcode.IsChecked.Value, bar_code_height.Text, label_sheet_dd.SelectedValue.ToString(), tb_no_of_prints.Text, nud_start_row.Value.ToString(), nud_start_column.Value.ToString()); controller.SaveUpdateLabel(model); inventory product = new inventory(); NavigationService.Navigate(product); }
private void btn_back_Click(object sender, RoutedEventArgs e) { inventory product = new inventory(); NavigationService.Navigate(product); }
public void NavigateToBackPage() { inventory form = new inventory(); NavigationService.Navigate(form); }