Exemple #1
0
 public ActionResult Index(string companyId, string branchId, string accountNo, string dateFrom, string dateTo)
 {
     try
     {
         DateTime?dfrom = null;
         DateTime?dto   = null;
         if (!string.IsNullOrEmpty(dateFrom))
         {
             dfrom = Convert.ToDateTime(dateFrom);
             dfrom = new DateTime(dfrom.Value.Year, dfrom.Value.Month, dfrom.Value.Day, 0, 0, 0);
         }
         if (!string.IsNullOrEmpty(dateTo))
         {
             dto = Convert.ToDateTime(dateTo);
             dto = new DateTime(dto.Value.Year, dto.Value.Month, dto.Value.Day, 23, 59, 59);
         }
         List <BankLedgerViewModel> bankLedgerVm = new List <BankLedgerViewModel>();
         if (!string.IsNullOrEmpty(accountNo) && !string.IsNullOrEmpty(dateFrom) && !string.IsNullOrEmpty(dateTo))
         {
             bankLedgerVm = Mapper.Map <List <BankLedgerViewModel> >(_bankLedgerService.GetAll(companyId, branchId, accountNo, dfrom.Value, dto.Value).ToList());
         }
         if (!string.IsNullOrEmpty(accountNo))
         {
             bankLedgerVm = Mapper.Map <List <BankLedgerViewModel> >(_bankLedgerService.GetAll(companyId, branchId, accountNo).ToList());
         }
         return(View(bankLedgerVm));
     }
     catch (Exception ex)
     {
         return(JavaScript($"ShowResult('{ex.Message}','failure')"));
     }
 }
Exemple #2
0
 public ActionResult Index(string accountNo)
 {
     try
     {
         var identity = (LoginIdentity)Thread.CurrentPrincipal.Identity;
         List <BankLedgerViewModel> bankLedgerVm = new List <BankLedgerViewModel>();
         if (!string.IsNullOrEmpty(accountNo))
         {
             bankLedgerVm = Mapper.Map <List <BankLedgerViewModel> >(_bankLedgerService.GetAll(identity.CompanyId, identity.BranchId, accountNo).ToList());
         }
         return(View(bankLedgerVm));
     }
     catch (Exception ex)
     {
         return(JavaScript($"ShowResult('{ex.Message}','failure')"));
     }
 }