Ejemplo n.º 1
0
        // GET: ISellerReciepts/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var iSellerReciept = await _context.ISellerReciepts
                                 .Include(i => i.Merchant)
                                 .FirstOrDefaultAsync(m => m.ISellerRecieptID == id);

            if (iSellerReciept == null)
            {
                return(NotFound());
            }
            var items = _context.ISellerRecieptItems.Include(i => i.Fish).Include(i => i.ProductionType).Where(i => i.ISellerRecieptID == iSellerReciept.ISellerRecieptID).ToList();
            ISellerRecieptDetailsVm model = new ISellerRecieptDetailsVm();

            model.ISellerReciept      = iSellerReciept;
            model.ISellerRecieptItems = items;
            ViewBag.MerchantDebts     = _context.Merchants.Where(c => c.MerchantID == iSellerReciept.MerchantID).FirstOrDefault().PreviousDebts;
            if (iSellerReciept.ReceiptImage != null)
            {
                ViewBag.ImageExists = true;
            }
            else
            {
                ViewBag.ImageExists = false;
            }
            return(View(model));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Moneytization(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var iSellerReciept = await _context.ISellerReciepts
                                 .Include(i => i.Merchant)
                                 .FirstOrDefaultAsync(m => m.ISellerRecieptID == id);

            if (iSellerReciept == null)
            {
                return(NotFound());
            }
            var items = _context.ISellerRecieptItems.Include(i => i.Fish).Include(i => i.ProductionType).Where(i => i.ISellerRecieptID == iSellerReciept.ISellerRecieptID).ToList();
            ISellerRecieptDetailsVm model = new ISellerRecieptDetailsVm();

            model.ISellerReciept      = iSellerReciept;
            model.ISellerRecieptItems = items;
            ViewBag.PreviousDebts     = _context.Merchants.FirstOrDefault(m => m.MerchantID == iSellerReciept.MerchantID).PreviousDebts;
            return(View(model));
        }