Exemplo n.º 1
0
        public JsonResult CheckDuplicateBranchUserUserName(string loginName)
        {
            bool flag;

            flag = new ATLTravelPortal.Areas.Administrator.Repository.BranchOfficeManagementProvider().CheckDuplicateBranchUsername(loginName);

            JsonResult res = new JsonResult
            {
                Data = flag
            };

            return(res);
        }
Exemplo n.º 2
0
        public JsonResult CheckDuplicateBranchOfficeEmail(string Email)
        {
            bool flag;

            flag = new ATLTravelPortal.Areas.Administrator.Repository.BranchOfficeManagementProvider().CheckDuplicateEmail(Email);

            JsonResult res = new JsonResult
            {
                Data = flag
            };

            return(res);
        }
Exemplo n.º 3
0
        public List <SalesReportModel> GetDistributorSalesReportSummaryDetails(int?AgentId, DateTime?fromdate, DateTime?todate, int AirlinesTypeId, int?currencyId)
        {
            ATLTravelPortal.Areas.Administrator.Repository.DistributorManagementProvider  distributorManagementProvider  = new ATLTravelPortal.Areas.Administrator.Repository.DistributorManagementProvider();
            ATLTravelPortal.Areas.Administrator.Repository.BranchOfficeManagementProvider branchOfficeManagementProvider = new ATLTravelPortal.Areas.Administrator.Repository.BranchOfficeManagementProvider();

            List <Air_GetAgentBillingStatementDetails_Result> data = ent.Air_GetAgentBillingStatementDetails(null, fromdate, todate, currencyId).ToList();

            var ts = SessionStore.GetTravelSession();
            var agentsByBranchOffice = branchOfficeManagementProvider.GetAllAgentsByBranchOfficeId(ts.LoginTypeId);

            List <Air_GetAgentBillingStatementDetails_Result> result = new List <Air_GetAgentBillingStatementDetails_Result>();


            if (AgentId != null)
            {
                int appUserId           = branchOfficeManagementProvider.GetAppUserIdByDistributorId(AgentId.Value);
                var agentsByDistributor = distributorManagementProvider.GetAllAgentsByDistributorId(appUserId);

                result = agentsByDistributor.SelectMany(b => data.Where(x => x.AgentId == b.AgentId)).ToList();
            }
            else
            {
                result = agentsByBranchOffice.SelectMany(b => data.Where(x => x.AgentId == b.AgentId)).ToList();
            }



            List <SalesReportModel> model = new List <SalesReportModel>();

            foreach (var item in result)
            {
                var SalesReportModel = new SalesReportModel();
                SalesReportModel.AirlineCode  = item.Code;
                SalesReportModel.AirlineName  = item.Name;
                SalesReportModel.TicketNumber = item.TicketNumber;
                SalesReportModel.IssuedDate   = item.IssueDate;

                SalesReportModel.Cash = item.Cash;
                TotalAgentBillingStatementDetails_Cash = TotalAgentBillingStatementDetails_Cash + (decimal)item.Cash;
                SalesReportModel.SumAgentBillingStatementDetails_Cash = TotalAgentBillingStatementDetails_Cash;

                SalesReportModel.Tax = (decimal)item.Tax;
                TotalAgentBillingStatementDetails_Tax = TotalAgentBillingStatementDetails_Tax + (decimal)item.Tax;
                SalesReportModel.SumAgentBillingStatementDetails_Tax = TotalAgentBillingStatementDetails_Tax;

                SalesReportModel.Commission = (decimal)item.Commission;
                TotalAgentBillingStatementDetails_Commission = TotalAgentBillingStatementDetails_Commission + (decimal)item.Commission;
                SalesReportModel.SumAgentBillingStatementDetails_Commission = TotalAgentBillingStatementDetails_Commission;

                SalesReportModel.Payable = (decimal)item.Payable;
                TotalAgentBillingStatementDetails_Payable = TotalAgentBillingStatementDetails_Payable + (decimal)item.Payable;
                SalesReportModel.SumAgentBillingStatementDetails_Payable = TotalAgentBillingStatementDetails_Payable;

                SalesReportModel.AgentName           = item.Agent;
                SalesReportModel.serviceProviderName = item.ServiceProviderName;
                SalesReportModel.issueFrom           = item.IssueFrom;
                SalesReportModel.AgentId             = item.AgentId;
                SalesReportModel.AgentCode           = new ATLTravelPortal.Areas.Airline.Repository.BookedTicketReportProvider().GetAgentCodeById(item.AgentId);

                model.Add(SalesReportModel);
            }
            return(model);
        }
Exemplo n.º 4
0
        public JsonResult FindBranchOffice(string searchText, int maxResult)
        {
            var result = new ATLTravelPortal.Areas.Administrator.Repository.BranchOfficeManagementProvider().GetBranchOfficeName(searchText, maxResult);

            return(Json(result));
        }