예제 #1
0
        // GET: Sales/Details/5
        public ActionResult Details(int id)
        {
            if (id == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Views_Invoinces_Details sales = invoicesB.GetById(id, true);

            sales.Date              = sales.CurrentDate.ToShortDateString();
            sales.Products          = saleB.GetById(sales.IdDetail).ToList();
            sales.AssetsLiabilities = assetsLiabilitiesB.GetByIdInvoinces(id).ToList();

            if (sales.Products != null)
            {
                foreach (var item in sales.AssetsLiabilities)
                {
                    sales.Payments = sales.Payments + item.Rode;
                }

                sales.Residue = sales.Total - sales.Payments;
                return(PartialView(sales));
            }

            return(PartialView(sales));
        }
예제 #2
0
        public IHttpActionResult GetInvoicesDetails(Int64 id)
        {
            Views_Invoinces_Details invoice = null;

            InvoicesB invoiceB = new InvoicesB();

            invoice = invoiceB.GetById(id, true);

            if (invoice == null)
            {
                Ok(false);
            }

            return(Ok(invoice));
        }