void GetOptionsandTaxValues() { OptionsEntity oData = new OptionsEntity(); ITodoUnpaidDetailRepository paymentRepository = new TodoUnpaidDetailRepository(); oData = paymentRepository.GetOptionSettings(); if (oData != null) { this.CurrencyName = oData.CurrencyCode; //there is no currency name field in database this.CurrencyCode = oData.CurrencyCode; this.CurrencyFormat = oData.NumberFormat; this.DecimalPlaces = oData.DecimalPlaces; } else { this.CurrencyName = "USD"; this.CurrencyCode = "USD"; this.CurrencyFormat = "en-US"; } TaxModel objDefaultTax = new TaxModel(); objDefaultTax = paymentRepository.GetDefaultTaxes().FirstOrDefault(); if (objDefaultTax != null) { this.TaxName = objDefaultTax.TaxName; } else { this.TaxName = "GST"; } }
/// <summary> /// Save Data /// </summary> /// <param name="param"></param> void SaveData(object param) { Mouse.OverrideCursor = Cursors.Wait; ITodoUnpaidDetailRepository todoRepository = new TodoUnpaidDetailRepository(); var result = todoRepository.SavePromisedDate(this.ListDueDays, this.DateFormat); Mouse.OverrideCursor = null; }
void ShowBoth(object param) { this.ShowDetailTrue = true; this.ShowSummaryTrue = false; ITodoUnpaidDetailRepository paymentRepository = new TodoUnpaidDetailRepository(); //GetOptionsandTaxValues(); this.ListDueDays = paymentRepository.GetAllData(2); this.UnpaidPurchaseTrue = false; this.UnpaidPurSalesTrue = true; this.UnpaidSalesTrue = false; this.UnpaidSummaryTrue = false; DefaultList = this.ListDueDays; this.ListDueDayscmbSup = this.ListDueDays.GroupBy(x => x.Name).Select(y => y.First()).OrderBy(x => x.Name).ToList(); this.ListDueDayscmbInv = this.ListDueDays.GroupBy(x => x.InvoiceNo).Select(y => y.First()).OrderBy(x => x.InvoiceNo).ToList(); this.ShowSelectedCount = this.ListDueDays.Count(); }
/// <summary> /// Intial Calling method /// </summary> /// <param name="param"></param> void ShowSummary(object param) { this.ShowDetailTrue = false; this.ShowSummaryTrue = true; ITodoUnpaidDetailRepository paymentRepository = new TodoUnpaidDetailRepository(); //GetOptionsandTaxValues(); this.TodoSummary = paymentRepository.GetSummaryData(); this.TotalSalesInvoice = Convert.ToString(this.TodoSummary.Sum(e => e.UnpaidSalesInvoice)); this.TotalPurchaseInvoiceNo = Convert.ToString(this.TodoSummary.Sum(e => e.UnpaidPurchaseInvoice)); this.TotalNetAmount = Convert.ToString(this.TodoSummary.Sum(e => e.NetAmount)); this.UnpaidPurchaseTrue = false; this.UnpaidPurSalesTrue = false; this.UnpaidSalesTrue = false; this.UnpaidSummaryTrue = true; this.ShowSelectedCount = this.TodoSummary.Count(); //DefaultList = this.ListDueDays; //this.ListDueDayscmbSup = this.ListDueDays.GroupBy(x => x.Name).Select(y => y.First()).OrderBy(x => x.Name).ToList(); //this.ListDueDayscmbInv = this.ListDueDays.GroupBy(x => x.InvoiceNo).Select(y => y.First()).OrderBy(x => x.InvoiceNo).ToList(); }
//void NavigateToSupplier(object param) //{ // string obj = param.ToString(); // SharedValues.getValue = obj; // var mainview = ServiceLocator.Current.GetInstance<SupplierDetailView>(); // var mainregion = this.regionManager.Regions[RegionNames.MainRegion]; // mainregion.Add(mainview); // if (mainregion != null) // { // mainregion.Activate(mainview); // } // var tabview = ServiceLocator.Current.GetInstance<SupplierTabView>(); // var tabregion = this.regionManager.Regions[RegionNames.MenuBarRegion]; // tabregion.Add(tabview); // if (tabregion != null) // { // tabregion.Activate(tabview); // } // eventAggregator.GetEvent<TabVisibilityEvent>().Publish(true); // eventAggregator.GetEvent<SubTabVisibilityEvent>().Publish(false); // eventAggregator.GetEvent<TitleChangedEvent>().Publish("Suppliers Details Form"); //} void ShowSales(object param) { this.ShowDetailTrue = true; this.ShowSummaryTrue = false; ITodoUnpaidDetailRepository paymentRepository = new TodoUnpaidDetailRepository(); //GetOptionsandTaxValues(); this.ListDueDays = paymentRepository.GetAllData(1); this.UnpaidPurchaseTrue = false; this.UnpaidPurSalesTrue = false; this.UnpaidSalesTrue = true; this.UnpaidSummaryTrue = false; DefaultList = this.ListDueDays; this.ListDueDayscmbSup = this.ListDueDays.GroupBy(x => x.Name).Select(y => y.First()).OrderBy(x => x.Name).ToList(); this.ListDueDayscmbInv = this.ListDueDays.GroupBy(x => x.InvoiceNo).Select(y => y.First()).OrderBy(x => x.InvoiceNo).ToList(); this.ShowSelectedCount = this.ListDueDays.Count(); OptionsEntity oData = new OptionsEntity(); ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository(); oData = purchaseRepository.GetOptionSettings(); this.DateformatStr = oData.DateFormat.ToString(); }