Exemplo n.º 1
0
        public IActionResult OnPostCloseBillManually(int BhId)
        {
            StatusMessage = _SalesTrans.CloseExternalBillManually(BhId).GetAwaiter().GetResult();

            return(RedirectToPage("/Sales/ExternalBillings/Index"));
        }
        //public IActionResult OnGet(string CustomerName = null, bool ShowAll = false)
        //{
        //    StringBuilder Param = new StringBuilder();
        //    Param.Append("&SearchCustomer=");

        //    if (CustomerName != null)
        //    {
        //        Param.Append(CustomerName);
        //    }

        //    Param.Append("&CustomerName=");


        //    if (ShowAll == true)
        //    {
        //        Param.Append(ShowAll);
        //    }

        //    Param.Append("&ShowAll=");

        //    CustomerList = _db.Customer.ToList();

        //    if (CustomerName != null)
        //    {
        //        if (ShowAll == true)
        //        {
        //            ExternalBillHeaderList =   _db.ExternalBillHeader
        //           .Where(b => b.Customer.CompanyName.ToLower().Contains(CustomerName.ToLower())).ToList()
        //           .OrderByDescending(b => b.CreatedDataTime);
        //        }
        //        else
        //        {

        //            ExternalBillHeaderList = _db.ExternalBillHeader
        //                .Where(b => b.Status == SD.OpenBill & b.Customer.CompanyName.ToLower().Contains(CustomerName.ToLower())).ToList()
        //                .OrderByDescending(b => b.CreatedDataTime);
        //        }
        //    }
        //    else
        //    {
        //        if (ShowAll == true)
        //        {
        //            ExternalBillHeaderList = _db.ExternalBillHeader
        //                .OrderByDescending(b => b.CreatedDataTime);

        //        }
        //        else
        //        {
        //            ExternalBillHeaderList = _db.ExternalBillHeader
        //                .Where(b => b.Status == SD.OpenBill).ToList()
        //                .OrderByDescending(b => b.CreatedDataTime);
        //        }
        //    }
        //        return Page();
        //}

        public IActionResult OnPostCloseBillManually(int ExternalHeaderId)
        {
            StatusMessage = _SalesTrans.CloseExternalBillManually(ExternalHeaderId).GetAwaiter().GetResult();

            return(RedirectToPage("/Sales/ExternalBillings/Index", new { CustomerName = "" }));
        }