public MobileTopupModel GetMobileTopupModel(MobileTopupModel model) { model.Agents = new SelectList(generalProvider.GetAgentList(), "AgentId", "AgentName"); model.ServiceProviders = new SelectList(GetServiceProviders(), "ServiceProviderId", "ServiceProviderName"); model.MobileTopupModelList = ListMobileTopupReport(model.AgentId, model.FromDate, model.ToDate, model.ServiceProviderId, model.IsSucces); model.SuccessFlags = new SelectList(GetSuccessFlags(), "Value", "Text", "true"); model.IsSucces = true; return(model); }
public ActionResult Index(int?pageNo, int?flag) { MobileTopupProvider mobileTopupProvider = new MobileTopupProvider(); MobileTopupModel model = new MobileTopupModel(); model.FromDate = DateTime.Today; model.ToDate = DateTime.Today.AddHours(23).AddMinutes(59).AddSeconds(59); return(View(mobileTopupProvider.GetMobileTopupModel(model))); }
public ActionResult Index(ExportModel Expmodel, MobileTopupModel model, FormCollection frm, int?pageNo, int?flag) { MobileTopupProvider mobileTopupProvider = new MobileTopupProvider(); MobileTopupModel viewModel = mobileTopupProvider.GetMobileTopupModel(model); try { var ts = (TravelSession)Session["TravelPortalSessionInfo"]; //export GetExportTypeClicked(Expmodel, frm); if (Expmodel != null && (Expmodel.ExportTypeExcel != null || Expmodel.ExportTypeWord != null || Expmodel.ExportTypeCSV != null || Expmodel.ExportTypePdf != null)) { 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.MobileTopupModelList.Select(m => new { AgentName = m.AgentName, ServiceProvierName = m.ServiceProvierName, SalesPrice = m.SalesPrice, SalesDate = m.SalesDate, IsSucces = m.IsSucces, StatusMessage = m.StatusMessage }); App_Class.AppCollection.Export(Expmodel, exportData, "Mobile Topup Report"); } return(View(viewModel)); } catch (Exception ex) { TempData["success"] = ex.Message; } return(View(viewModel)); }
public List <MobileTopupModel> ListMobileTopupReport(int?agentId, DateTime?fromdate, DateTime?todate, int?serviceProviderId, bool?isSuccess) { var data = entity.MRC_GetRechargeDetails(agentId, isSuccess, serviceProviderId == 0 ? null : serviceProviderId, fromdate, todate); List <MobileTopupModel> model = new List <MobileTopupModel>(); foreach (var item in data) { var MobileTopupModel = new MobileTopupModel { AgentName = item.AgentName, ServiceProvierName = item.ServiceProviderName, SalesPrice = item.Amount, SalesDate = item.SalesDate, IsSucces = item.IsSuccess, StatusMessage = item.StatusMessage }; model.Add(MobileTopupModel); } return(model.OrderByDescending(x => x.SalesDate).ToList()); }