public List <AgentCLApprovedModel> GetAgentCLApprovedList(DateTime fromdate, DateTime todate, int?userId, int?distributorID, int?agentId) { var data = entity.GL_GetAgentCLApprovedList(fromdate, todate, userId, distributorID, agentId); List <AgentCLApprovedModel> model = new List <AgentCLApprovedModel>(); foreach (var item in data.Select(x => x)) { var AgentCLApprovedModel = new AgentCLApprovedModel { DistributorName = item.DistributorName, BranchOfficeName = item.BranchOfficeName, AgentName = item.AgentName, AgentCode = item.Code, Currency = item.Currency, Amount = item.Amount, Type = item.Type, Requestion = item.Requeston, CheckerDate = item.CheckerDate, CheckedBy = item.CheckedBy, Comments = item.Comments, EffectiveFrom = item.EffectiveFrom, ExpireOn = item.ExpireOn }; model.Add(AgentCLApprovedModel); } return(model); }
public ActionResult Index(int?page, int?pageNo, int?flag, DateTime?FromDate, DateTime?ToDate, int?UserID, int?DistributorID, int?AgentId) { int currentPageIndex = page.HasValue ? page.Value : 1; int defaultPageSize = 50; AgentCLApprovedModel model = new AgentCLApprovedModel(); var ts = (TravelSession)Session["TravelPortalSessionInfo"]; if (FromDate == null) { model.FromDate = DateTime.Now.AddDays(-15); } else { model.FromDate = FromDate.Value; } if (ToDate == null) { model.ToDate = DateTime.Now; } else { model.ToDate = ToDate.Value; } model.UsersOption = new SelectList(defaultProvider.GetUserList(), "AppUserId", "FullName"); model.BranchOfficeOption = new SelectList(branchOfficeManagementProvider.GetAll(), "BranchOfficeId", "BranchOfficeName", model.BranchOfficeId); model.DistributorOption = new SelectList(agentclaapprovedprovider.GetAllDistributorsByBranchOfficeId(model.BranchOfficeId ?? 0), "DistributorId", "DistributorName"); model.AgentOption = new SelectList(agentclaapprovedprovider.GetAgentsByDistributorId(model.DistributorID ?? 0), "AgentId", "AgentName", model.AgentId); model.AgentReceiptList = agentReceiptsProvider.GetAgentCLApprovedList(FromDate != null ? FromDate.Value : model.FromDate, ToDate != null ? ToDate.Value : model.ToDate, model.UserID, model.DistributorID, model.AgentId).ToPagedList(currentPageIndex, defaultPageSize); return(View(model)); }
public List <AgentCLApprovedModel> GetAgentCLApprovedList(DateTime fromdate, DateTime todate, int?userId, int?distributorID, int?agentId) { var data = ent.GL_GetAgentRecepitList(fromdate, todate, userId, distributorID, agentId); List <AgentCLApprovedModel> model = new List <AgentCLApprovedModel>(); foreach (var item in data) { var AgentCLApprovedModel = new AgentCLApprovedModel { BranchOfficeName = item.BranchOfficeName, DistributorName = item.DistributorName, AgentName = item.AgentName, AgentCode = item.AgentCode, Currency = item.CurrencyCode, Amount = item.Amount, Comments = item.Narration1, VoucherNo = item.VoucherNo, CheckedBy = item.CreatedBy, CheckerDate = item.CreatedDate }; model.Add(AgentCLApprovedModel); } return(model); }
public ActionResult Index(ExportModel Expmodel, AgentCLApprovedModel model, FormCollection frm, int?pageNo, int?flag, int?page) { var ts = (TravelSession)Session["TravelPortalSessionInfo"]; int currentPageIndex = page.HasValue ? page.Value : 1; int defaultPageSize = 50; //export BookedTicketReportController crtBKT = new BookedTicketReportController(); crtBKT.GetExportTypeClicked(Expmodel, frm); if (Expmodel != null && (Expmodel.ExportTypeExcel != null || Expmodel.ExportTypeWord != null || Expmodel.ExportTypeCSV != null || Expmodel.ExportTypePdf != null)) { model.AgentCLApprovedListExport = agentReceiptsProvider.GetAgentCLApprovedList(model.FromDate, model.ToDate, model.UserID, model.DistributorID, model.AgentId); 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.AgentCLApprovedListExport.Select(m => new { BranchOffice_Name = m.BranchOfficeName, Distributor_Name = m.DistributorName, Agent_Name = m.AgentName, Agent_Code = m.AgentCode, Currency = m.Currency, Amount = m.Amount, Narration = m.Comments, VoucherNo = m.VoucherNo, CreatedBy = m.CheckedBy, CreatedDate = m.CheckerDate }); App_Class.AppCollection.Export(Expmodel, exportData, "Agent Receipts"); } catch { } } model.AgentReceiptList = agentReceiptsProvider.GetAgentCLApprovedList(model.FromDate, model.ToDate, model.UserID, model.DistributorID, model.AgentId).ToPagedList(currentPageIndex, defaultPageSize); model.UsersOption = new SelectList(defaultProvider.GetUserList(), "AppUserId", "FullName"); model.BranchOfficeOption = new SelectList(branchOfficeManagementProvider.GetAll(), "BranchOfficeId", "BranchOfficeName", model.BranchOfficeId); model.DistributorOption = new SelectList(agentclaapprovedprovider.GetAllDistributorsByBranchOfficeId(model.BranchOfficeId ?? 0), "DistributorId", "DistributorName"); model.AgentOption = new SelectList(agentclaapprovedprovider.GetAgentsByDistributorId(model.DistributorID ?? 0), "AgentId", "AgentName", model.AgentId); return(View(model)); }
public ActionResult Index(ExportModel Expmodel, AgentCLApprovedModel model, FormCollection frm, int?pageNo, int?flag) { var ts = (TravelSession)Session["TravelPortalSessionInfo"]; if (ts.UserTypeId == 6) { model.DistributorID = ts.LoginTypeId; } model.AgentCLApprovedListExport = agentCLApprovedProvider.GetAgentCLApprovedList(model.FromDate, model.ToDate, model.UserID, model.DistributorID, model.AgentId); //export BookedTicketReportController crtBKT = new BookedTicketReportController(); crtBKT.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.AgentCLApprovedListExport.Select(m => new { Brach_Office = m.BranchOfficeName, Distributor = m.DistributorName, Agent_Name = m.AgentName, Agent_Code = m.AgentCode, Currency = m.Currency, Amount = m.Amount, Type = m.Type, Requestion = m.Requestion, Checker_Date = m.CheckerDate, CheckerBy = m.CheckedBy }); App_Class.AppCollection.Export(Expmodel, exportData, "Issued Ticket"); } catch { } } model.UsersOption = new SelectList(agentCLApprovedProvider.GetDistributorUsers(model.DistributorID), "AppUserId", "FullName"); model.AgentOption = new SelectList(agentCLApprovedProvider.GetAgentsByDistributorId(model.DistributorID ?? 0), "AgentId", "AgentName", model.AgentId); return(View(model)); }
public ActionResult Index(ExportModel Expmodel, AgentCLApprovedModel model, FormCollection frm, int?pageNo, int?flag) { var ts = (TravelSession)Session["TravelPortalSessionInfo"]; model.AgentCLApprovedListExport = agentCLApprovedProvider.GetAgentCLApprovedList(model.FromDate, model.ToDate, model.UserID, model.DistributorID, model.AgentId); //export BookedTicketReportController crtBKT = new BookedTicketReportController(); crtBKT.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.AgentCLApprovedListExport.Select(m => new { Brach_Office = m.BranchOfficeName, Distributor = m.DistributorName, Agent_Name = m.AgentName, Agent_Code = m.AgentCode, Currency = m.Currency, Amount = m.Amount, Type = m.Type, Requestion = m.Requestion, Checker_Date = m.CheckerDate, CheckerBy = m.CheckedBy, Comments = m.Comments, Effective_From = m.EffectiveFrom, ExpireOn = m.ExpireOn }); App_Class.AppCollection.Export(Expmodel, exportData, "Agent Credit Limit"); } catch { } } model.UsersOption = new SelectList(defaultProvider.GetUserList(), "AppUserId", "FullName"); model.BranchOfficeOption = new SelectList(branchOfficeManagementProvider.GetAll(), "BranchOfficeId", "BranchOfficeName", model.BranchOfficeId); model.DistributorOption = new SelectList(agentCLApprovedProvider.GetAllDistributorsByBranchOfficeId(model.BranchOfficeId ?? 0), "DistributorId", "DistributorName"); model.AgentOption = new SelectList(agentCLApprovedProvider.GetAgentsByDistributorId(model.DistributorID ?? 0), "AgentId", "AgentName", model.AgentId); return(View(model)); }
public ActionResult Index(int?pageNo, int?flag) { AgentCLApprovedModel model = new AgentCLApprovedModel(); var ts = (TravelSession)Session["TravelPortalSessionInfo"]; model.FromDate = DateTime.Now.AddDays(-15); model.ToDate = DateTime.Now; model.UsersOption = new SelectList(defaultProvider.GetUserList(), "AppUserId", "FullName"); model.BranchOfficeOption = new SelectList(branchOfficeManagementProvider.GetAll(), "BranchOfficeId", "BranchOfficeName"); model.DistributorOption = new SelectList(agentCLApprovedProvider.GetAllDistributorsByBranchOfficeId(model.BranchOfficeId ?? 0), "DistributorId", "DistributorName"); model.AgentOption = new SelectList(agentCLApprovedProvider.GetAgentsByDistributorId(model.DistributorID ?? 0), "AgentId", "AgentName"); model.AgentCLApprovedListExport = agentCLApprovedProvider.GetAgentCLApprovedList(model.FromDate, model.ToDate, model.UserID, model.DistributorID, model.AgentId); return(View(model)); }
public ActionResult Index(int?pageNo, int?flag) { AgentCLApprovedModel model = new AgentCLApprovedModel(); var ts = (TravelSession)Session["TravelPortalSessionInfo"]; model.FromDate = DateTime.Now.AddDays(-15); model.ToDate = DateTime.Now; if (ts.UserTypeId == 6) { model.DistributorID = ts.LoginTypeId; } model.AgentCLApprovedListExport = agentCLApprovedProvider.GetAgentCLApprovedList(model.FromDate, model.ToDate, model.UserID, model.DistributorID, model.AgentId); model.UsersOption = new SelectList(agentCLApprovedProvider.GetDistributorUsers(model.DistributorID), "AppUserId", "FullName"); model.AgentOption = new SelectList(agentCLApprovedProvider.GetAgentsByDistributorId(model.DistributorID ?? 0), "AgentId", "AgentName", model.AgentId); return(View(model)); }