예제 #1
0
        public async Task <IActionResult> Index()
        {
            IEnumerable <CurrencyViewModel> currencies = await MasterHelpers.GetCurrency();

            IEnumerable <DestinationViewModel> destinations = await MasterHelpers.GetDestination();

            IEnumerable <LanguangeViewModel> languanges = await MasterHelpers.GetLanguange();

            IEnumerable <MeasurementViewModel> measurements = await MasterHelpers.GetMeasurements();

            IEnumerable <PurchaseViewModel> purchases = await MasterHelpers.GetPurchaseOrders();

            NumberViewModel numbers = await MasterHelpers.GetNumber();

            ViewBag.number = numbers.Number;
            BillAddModel model = new BillAddModel()
            {
                Currencies   = currencies,
                Destinations = destinations,
                Languanges   = languanges,
                Measurements = measurements,
                Purchases    = purchases,
                Number       = numbers.Number,
            };

            return(View(model));
        }
예제 #2
0
        public async Task <DestinationViewModel> GetDestination(string id)
        {
            DestinationViewModel data = MasterHelpers.GetDestination().GetAwaiter().GetResult().Where(s => s.DestinationId.Equals(id)).FirstOrDefault();

            return(data);
        }
예제 #3
0
        public async Task <string> GetCurrency(string id)
        {
            string data = MasterHelpers.GetCurrency().GetAwaiter().GetResult().Where(s => s.CurrencyId.Equals(id))?.FirstOrDefault().Code;

            return(data);
        }
예제 #4
0
        public async Task <string> Create(BillPostModel model, BillDetailPostModel billDetailPost)
        {
            await MasterHelpers.AddBill(model, billDetailPost);

            return(model.Number + " successfully added");
        }