Exemplo n.º 1
0
 // GET: Invoices/Create
 public ActionResult Create()
 {
     ViewBag.CustomerId = new SelectList(customerService.GetAll(), "Id", "FullName");
     ViewBag.ProductId  = new SelectList(productService.GetAll(), "Id", "Name");
     ViewBag.TaxId      = new SelectList(taxService.GetAll(), "Id", "Name");
     return(View());
 }
Exemplo n.º 2
0
 public static List <SelectListItem> GetTaxes(long sobId, DateTime startDate, DateTime endDate)
 {
     return(service.GetAll(AuthenticationHelper.CompanyId.Value, sobId)
            .Where(a => a.StartDate <= startDate && a.EndDate >= endDate)
            .Select(x => new SelectListItem
     {
         Text = x.TaxName,
         Value = x.Id.ToString()
     }).ToList());
 }
Exemplo n.º 3
0
        public ActionResult Index(string transactionType)
        {
            var result = taxService.GetAll();

            ViewBag.TransactionType = transactionType;
            return(View(result));
        }
Exemplo n.º 4
0
 private List <SelectListItem> GetTaxList()
 {
     return(_taxService.GetAll().OrderByDescending(x => x.Id).Select(x => new SelectListItem
     {
         Value = x.Id.ToString(),
         Text = "Kdv %" + x.Name
     }).ToList());
 }
        public ActionResult Edit(long customerId, long?id)
        {
            ViewBag.CustomerName = CustomerHelper.GetCustomer(customerId.ToString()).CustomerName;

            CustomerSiteModel model;

            if (id != null)
            {
                model = CustomerHelper.GetCustomerSite(id.Value.ToString());
                CodeCombinitionCreateViewModel codeCombination = CodeCombinationHelper.GetCodeCombination(model.CodeCombinationId.ToString());

                model.CodeCombinationString = Utility.Stringize(".", codeCombination.Segment1, codeCombination.Segment2, codeCombination.Segment3,
                                                                codeCombination.Segment4, codeCombination.Segment5, codeCombination.Segment6, codeCombination.Segment7, codeCombination.Segment8);
            }

            else
            {
                model            = new CustomerSiteModel();
                model.CustomerId = customerId;
            }

            model.TaxCode = taxService.GetAll(AuthenticationHelper.CompanyId.Value)
                            .Select(x => new SelectListItem
            {
                Text  = x.TaxName,
                Value = x.Id.ToString()
            }).ToList();
            model.TaxId = model.TaxCode.Any() ? Convert.ToInt64(model.TaxCode.First().Value) : 0;

            //model.CodeCombination = codeCombinationService.GetAllCodeCombinitionView(AuthenticationHelper.CompanyId.Value)
            //        .Select(x => new SelectListItem
            //        {
            //            Text = x.CodeCombinitionCode,
            //            Value = x.Id.ToString()
            //        }).ToList();
            //model.CodeCombinationId = model.CodeCombination.Any() ? Convert.ToInt64(model.CodeCombination.First().Value) : 0;

            return(View(model));
        }
        public ActionResult SaleDetail()
        {
            if (Session["UserId"] == null)
            {
                return(RedirectToAction("Login", "User"));
            }
            SaleViewModel saleviewmodel = new SaleViewModel();

            if (Session["UserId"] != null && (string)Session["Role"] == "Admin")
            {
                ViewBag.SetLayout = "~/Views/Shared/_Layout.cshtml";
            }
            else
            {
                saleviewmodel.BillNo      = _saleService.ExecuteSp();
                saleviewmodel.CreatedDate = System.DateTime.Now;
                ViewBag.Items             = _itemService.GetAll();
                ViewBag.Parties           = _partyService.GetAll();
                ViewBag.taxes             = _taxService.GetAll();
                ViewBag.SetLayout         = "~/Views/Shared/_UserLayout.cshtml";
            }

            return(View(saleviewmodel));
        }
Exemplo n.º 7
0
        public ActionResult PurchaseDetail()
        {
            if (Session["UserId"] == null)
            {
                return(RedirectToAction("Login", "User"));
            }
            PurchaseViewModel purchaseviewmodel = new PurchaseViewModel();

            if (Session["UserId"] != null && (string)Session["Role"] == "Admin")
            {
                ViewBag.SetLayout = "~/Views/Shared/_Layout.cshtml";
            }

            else
            {
                purchaseviewmodel.PurchaseDate = System.DateTime.Now;
                ViewBag.Parties   = partyService.GetAll();
                ViewBag.taxes     = taxService.GetAll();
                ViewBag.Items     = itemService.GetAll();
                ViewBag.SetLayout = "~/Views/Shared/_UserLayout.cshtml";
            }

            return(View(purchaseviewmodel));
        }
Exemplo n.º 8
0
        // GET: Taxes
        public ActionResult Index()
        {
            var taxes = Mapper.Map <IEnumerable <TaxViewModel> >(taxService.GetAll());

            return(View(taxes));
        }
        public JsonResult TaxDetails()
        {
            var tax = _taxService.GetAll();

            return(Json(tax, JsonRequestBehavior.AllowGet));
        }