public ActionResult Index(int?page, DateTime?FromDate, DateTime?ToDate) { var ts = SessionStore.GetTravelSession(); //var agents = ser.GetAgentsList().Where(x => x.CreatedBy == ts.AppUserId); var agents = ser.GetAgentsList().Where(x => x.DistributorId == ts.LoginTypeId); ViewData["Agents"] = new SelectList(agents, "AgentId", "AgentName"); int currentPageIndex = page.HasValue ? page.Value : 1; int defaultPageSize = 30; PendingBookingModel model = new PendingBookingModel(); if (FromDate == null && ToDate == null) { model.FromDate = GeneralRepository.CurrentDateTime().AddDays(-15); model.ToDate = GeneralRepository.CurrentDateTime(); } else { model.FromDate = FromDate; model.ToDate = ToDate; } //var agentsByDistributor = distributorManagementProvider.GetAllAgentsByDistributorId(ts.AppUserId); //var details = ser.ListPendingBookintReport(model.AgentId, model.FromDate, model.ToDate); //var result = agentsByDistributor.SelectMany(b => details.Where(x => x.AgentId == b.AgentId).ToList()); var details = ser.ListPendingBookintReport(model.AgentId, model.FromDate, model.ToDate); var result = details.Where(x => x.DistributorId == ts.LoginTypeId); model.PendingBookingList = result.ToPagedList(currentPageIndex, defaultPageSize); return(View(model)); }
public ActionResult Edit(int Id, MakePaymentModel model) { var ts = SessionStore.GetTravelSession();; model.AgentId = ts.LoginTypeId; model.UpdatedBy = ts.AppUserId; model.UpdatedDate = DateTime.UtcNow; model.CreatedBy = ts.AppUserId; model.DepositId = Id; MakePaymentModel m = new MakePaymentModel(); ViewData["Bank"] = new SelectList(ser.AllBank(), "BankId", "BankName"); ViewData["BankBranch"] = new SelectList(ser.AllBankBranch(model.BankId), "BankBranchId", "BranchName"); ViewData["ChequeDrawnOnBank"] = new SelectList(ser.GetBank(), "BankId", "BankName"); model.SalesAgentList = ser.GetAllGetSalesAgentList(); m = ser.GetBranchDistributroPaymentDetail(Id); model.flag = "DistributorMakePayment"; if (model.rdbPaymentMode.ToString() == "Cash") { model.PaymentModeId = 1; ser.BranchCashEdit(model); } if (model.rdbPaymentMode.ToString() == "Cheque") { model.PaymentModeId = 2; ser.BranchChequeEdit(model); } if (model.rdbPaymentMode.ToString() == "Draft") { model.PaymentModeId = 3; ser.BranchDraftEdit(model); } if (model.rdbPaymentMode.ToString() == "BankTransfer") { model.PaymentModeId = 4; ser.BranchBankTransferEdit(model); } if (model.rdbPaymentMode.ToString() == "RTGS") { model.PaymentModeId = 5; ser.BranchRTGSEdit(model); } if (model.rdbPaymentMode.ToString() == "CashGivenTo") { model.PaymentModeId = 6; ser.BranchCashGivenToEdit(model); } return(RedirectToAction("Index")); }
public ActionResult Index(ExportModel Expmodel, SalesReportModel model, FormCollection frm, int?pageNo, int?flag) { var ts = SessionStore.GetTravelSession(); model.salesReportSummary = ser.GetDistributorSalesReportSummary(model.AgentId, model.FromDate, model.ToDate, model.AirlineTypesId, model.Currency); model.salesReportDetails = ser.GetDistributorSalesReportSummaryDetails(model.AgentId, model.FromDate, model.ToDate, model.AirlineTypesId, model.Currency); //export ctrlBKT.GetExportTypeClicked(Expmodel, frm); if (Expmodel != null && (Expmodel.ExportTypeExcel != null || Expmodel.ExportTypeWord != null || Expmodel.ExportTypeCSV != null || Expmodel.ExportTypePdf != null)) { try { if (Expmodel.ExportTypeExcel != null) { Expmodel.ExportTypeExcel = Expmodel.ExportTypeExcel; } else if (Expmodel.ExportTypeWord != null) { Expmodel.ExportTypeWord = Expmodel.ExportTypeWord; } else if (Expmodel.ExportTypePdf != null) { Expmodel.ExportTypePdf = Expmodel.ExportTypePdf; } var exportData = model.salesReportSummary.Select(m => new { Code = m.AirlineCode, Cash = m.Cash, Tax = m.Tax, Comm = m.Commission, Payable = m.Payable }); App_Class.AppCollection.Export(Expmodel, exportData, "SalesReport"); } catch (Exception ex) { TempData["ActionResponse"] = ex.Message; } } ViewData["AgentList"] = new SelectList(defaultProvider.GetDistributorList(ts.LoginTypeId), "DistributorId", "DistributorName"); ViewData["AirlineTypes"] = new SelectList(ser.GetAirlineTypesList(), "AirineTypeId", "TypeName"); ViewData["Currency"] = defaultProvider.GetCurrencyList(); return(View(model)); }
public ActionResult Index() { LedgerTransactionSummaryModel model = new LedgerTransactionSummaryModel(); var ts = SessionStore.GetTravelSession(); model.DateFrom = DateTime.Now.AddDays(-15); model.DateTo = DateTime.Now; model.ProductsOption = ledgerTransactionSummaryProvider.GetProductOption(); model.CurrencyOption = ledgerTransactionSummaryProvider.GetCurrencyOption(); model.LedgerOfOption = ledgerTransactionSummaryProvider.GetLedgerOfOption(); model.FilterTypeOption = ledgerTransactionSummaryProvider.GerFilterTypeoption(); return(View(model)); }
public ActionResult Index() { var ts = SessionStore.GetTravelSession();; MakePaymentModel model = new MakePaymentModel(); model.AgentId = ts.LoginTypeId; model.ChequeList = ser.GetChequeList(model.AgentId); model.DraftList = ser.GetDraftList(model.AgentId); model.CashList = ser.GetCashList(model.AgentId); model.BankTransferList = ser.GetBankTransferList(model.AgentId); model.RTGSList = ser.GetRTGSList(model.AgentId); model.CashGivenToList = ser.GetCashGivenToList(model.AgentId); model.CreditList = ser.GetCreditRequestList(model.AgentId); return(View(model)); }