Beispiel #1
0
        public ActionResult Edit(DistributorManagementModel model, int id)
        {
            try
            {
                TravelSession sessionObj = AdminSessionStore.GetTravelSession();
                model.UpdatedBy = sessionObj.AppUserId;

                model.DistributorId = id;
                distributorManagementProvider.EditDistributedManagement(model);
                model = distributorManagementProvider.GetDistributorsModel(id);
                TempData["InfoMessage"] = "Distributor Updated Successfully.";
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                model.Countries            = new SelectList(agentManagementProvider.GetCountry(), "CountryId", "CountryName", model.NativeCountryId);
                model.StatusOption         = new SelectList(agentManagementProvider.GetStatus(), "id", "Name", model.Status);
                model.Zones                = new SelectList(agentManagementProvider.GetZoneList(), "ZoneId", "ZoneName", model.ZoneId);
                model.Districts            = new SelectList(agentManagementProvider.GetDistrictListbyZoneId(1), "DistrictId", "DistrictName", model.DistrictId);
                model.TimeZones            = new SelectList(agentManagementProvider.GetTimeZoneList(), "RecordID", "StandardName", model.TimeZoneId);
                model.BranchOffices        = new SelectList(distributorManagementProvider.GetBranchOffices(), "BranchOfficeId", "BranchOfficeName", model.BranchOfficeId);
                TempData["ActionResponse"] = ex.Message;

                return(View(model));
            }
        }
        public ActionResult Edit(int id)
        {
            TravelSession sessionObj         = AdminSessionStore.GetTravelSession();
            DistributorManagementModel model = new DistributorManagementModel();

            try
            {
                model = distributorManagementProvider.GetDistributorsModel(id);

                model.MasterDealIdOfAirlines = provider.GetBranchOfficeMasterDealforDistributors(id, 1) != null?provider.GetBranchOfficeMasterDealforDistributors(id, 1).BranchDealMasterId : 0;

                model.MasterDealIdOfHotel = provider.GetBranchOfficeMasterDealforDistributors(id, 2) != null?provider.GetBranchOfficeMasterDealforDistributors(id, 2).BranchDealMasterId : 0;

                model.MasterDealIdOfBus = provider.GetBranchOfficeMasterDealforDistributors(id, 4) != null?provider.GetBranchOfficeMasterDealforDistributors(id, 4).BranchDealMasterId : 0;

                model.MasterDealIdOfMobile = provider.GetBranchOfficeMasterDealforDistributors(id, 3) != null?provider.GetBranchOfficeMasterDealforDistributors(id, 3).BranchDealMasterId : 0;

                model.MasterDealNameListOfAirlines = provider.GetAllBranchDistributorDealListOfAirlines(sessionObj.LoginTypeId);
                model.MasterDealNameListOfHotels   = provider.GetAllBranchDistributorDealListOfHotels(sessionObj.LoginTypeId);
                model.MasterDealNameListOfBus      = provider.GetAllBranchDistributorDealListOfBus(sessionObj.LoginTypeId);
                model.MasterDealNameListOfMobile   = provider.GetAllBranchDistributorDealListOfMobile(sessionObj.LoginTypeId);

                ViewData["distributorClass"] = new SelectList(provider.GetDistributorClass(), "DistributorClassId", "DistributorClassName");
                model.DistributorClassId     = provider.GeDistributorClass(id);

                return(View(model));
            }
            catch (Exception ex)
            {
                model.Countries     = new SelectList(agentManagementProvider.GetCountry(), "CountryId", "CountryName", model.NativeCountryId);
                model.StatusOption  = new SelectList(agentManagementProvider.GetStatus(), "id", "Name", model.Status);
                model.Zones         = new SelectList(agentManagementProvider.GetZoneList(), "ZoneId", "ZoneName", model.ZoneId);
                model.Districts     = new SelectList(agentManagementProvider.GetDistrictListbyZoneId(1), "DistrictId", "DistrictName", model.DistrictId);
                model.TimeZones     = new SelectList(agentManagementProvider.GetTimeZoneList(), "RecordID", "StandardName", model.TimeZoneId);
                model.BranchOffices = new SelectList(distributorManagementProvider.GetBranchOffices(), "BranchOfficeId", "BranchOfficeName", model.BranchOfficeId);


                model.MasterDealIdOfAirlines = provider.GetBranchOfficeMasterDealforDistributors(id, 1) != null?provider.GetBranchOfficeMasterDealforDistributors(id, 1).BranchDealMasterId : 0;

                model.MasterDealIdOfHotel = provider.GetBranchOfficeMasterDealforDistributors(id, 2) != null?provider.GetBranchOfficeMasterDealforDistributors(id, 2).BranchDealMasterId : 0;

                model.MasterDealIdOfBus = provider.GetBranchOfficeMasterDealforDistributors(id, 4) != null?provider.GetBranchOfficeMasterDealforDistributors(id, 4).BranchDealMasterId : 0;

                model.MasterDealIdOfMobile = provider.GetBranchOfficeMasterDealforDistributors(id, 3) != null?provider.GetBranchOfficeMasterDealforDistributors(id, 3).BranchDealMasterId : 0;

                model.MasterDealNameListOfAirlines = provider.GetAllBranchDistributorDealListOfAirlines(sessionObj.LoginTypeId);
                model.MasterDealNameListOfHotels   = provider.GetAllBranchDistributorDealListOfHotels(sessionObj.LoginTypeId);
                model.MasterDealNameListOfBus      = provider.GetAllBranchDistributorDealListOfBus(sessionObj.LoginTypeId);
                model.MasterDealNameListOfMobile   = provider.GetAllBranchDistributorDealListOfMobile(sessionObj.LoginTypeId);

                ViewData["distributorClass"] = new SelectList(provider.GetDistributorClass(), "DistributorClassId", "DistributorClassName");
                model.DistributorClassId     = provider.GeDistributorClass(id);

                TempData["ActionResponse"] = ex.Message;
                return(View(model));
            }
        }
Beispiel #3
0
        public int SendMassEmails(MassEmailingModel model)
        {
            var ts = AdminSessionStore.GetTravelSession();

            System.Data.Objects.ObjectParameter numberOfEmailSent = new System.Data.Objects.ObjectParameter("NumberOfEmailSent", 0);
            string agentIds = GetAgentIds(model.SpecifiedAgents);

            entity.Core_SendMassEmails(model.AgentClassId, model.AgentTypeId, model.AgentDealId, model.DistrictId, model.ZoneId,
                                       !string.IsNullOrEmpty(agentIds) ? agentIds : null, model.FreeEmail, model.Subject, model.EmailMessage, ts.AppUserId, numberOfEmailSent);

            return((int)numberOfEmailSent.Value);
        }
        public ActionResult Index(int?IsActive, string id)
        {
            DistributorManagementModel model = new DistributorManagementModel();

            try
            {
                //string alphabet = string.IsNullOrEmpty(id) ? "A" : id;
                TravelSession sessionObj = AdminSessionStore.GetTravelSession();
                string        alphabet   = string.IsNullOrEmpty(id) ? "" : id;
                model.Distributors = distributorManagementProvider.GetBranchDistributorsList(sessionObj.LoginTypeId).Distributors.Where(aa => (aa.DistributorName.StartsWith(alphabet)));

                bool status = IsActive == 1 ? true : false;

                if (Request.IsAjaxRequest())
                {
                    if (IsActive != 0 && id == "")
                    {
                        model.Distributors = model.Distributors.Where(aa => aa.Status == Convert.ToInt32(status)).ToList();
                        return(PartialView("VUC_DistributorList", model.Distributors));
                    }
                    else if (IsActive == null && id != "")
                    {
                        return(PartialView("VUC_DistributorList", model.Distributors));
                    }
                    else if (IsActive == 0 && id != "")
                    {
                        return(PartialView("VUC_DistributorList", model.Distributors));
                    }
                    else
                    {
                        model.Distributors = model.Distributors.Where(aa => aa.Status == Convert.ToInt32(status)).ToList();
                        return(PartialView("VUC_DistributorList", model.Distributors));
                    }
                }

                return(View(model));
            }
            catch (Exception ex)
            {
                TempData["ActionResponse"] = ex.Message;
                return(View(model));
            }
        }
        public ActionResult Edit(DistributorManagementModel model, int id)
        {
            TravelSession sessionObj = AdminSessionStore.GetTravelSession();

            try
            {
                model.UpdatedBy      = sessionObj.AppUserId;
                model.BranchOfficeId = sessionObj.LoginTypeId;

                model.DistributorId = id;
                distributorManagementProvider.EditDistributedManagement(model);

                SaveOrUpdateDistributorSetting(id, model, sessionObj);



                TempData["InfoMessage"] = "Distributor Updated Successfully.";
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                model               = distributorManagementProvider.GetDistributorsModel(id);
                model.Countries     = new SelectList(agentManagementProvider.GetCountry(), "CountryId", "CountryName", model.NativeCountryId);
                model.StatusOption  = new SelectList(agentManagementProvider.GetStatus(), "id", "Name", model.Status);
                model.Zones         = new SelectList(agentManagementProvider.GetZoneList(), "ZoneId", "ZoneName", model.ZoneId);
                model.Districts     = new SelectList(agentManagementProvider.GetDistrictListbyZoneId(1), "DistrictId", "DistrictName", model.DistrictId);
                model.TimeZones     = new SelectList(agentManagementProvider.GetTimeZoneList(), "RecordID", "StandardName", model.TimeZoneId);
                model.BranchOffices = new SelectList(distributorManagementProvider.GetBranchOffices(), "BranchOfficeId", "BranchOfficeName", model.BranchOfficeId);


                model.MasterDealIdOfAirlines = provider.GetBranchOfficeMasterDealforDistributors(id, 1) != null?provider.GetBranchOfficeMasterDealforDistributors(id, 1).BranchDealMasterId : 0;

                model.MasterDealIdOfHotel = provider.GetBranchOfficeMasterDealforDistributors(id, 2) != null?provider.GetBranchOfficeMasterDealforDistributors(id, 2).BranchDealMasterId : 0;

                model.MasterDealNameListOfAirlines = provider.GetAllBranchDistributorDealListOfAirlines(sessionObj.LoginTypeId);
                model.MasterDealNameListOfHotels   = provider.GetAllBranchDistributorDealListOfHotels(sessionObj.LoginTypeId);
                ViewData["distributorClass"]       = new SelectList(provider.GetDistributorClass(), "DistributorClassId", "DistributorClassName");
                model.DistributorClassId           = provider.GeDistributorClass(id);
                TempData["ActionResponse"]         = ex.Message;

                return(View(model));
            }
        }
Beispiel #6
0
        public int SendMassSMSs(MassEmailingModel model)
        {
            var    ts       = AdminSessionStore.GetTravelSession();
            string agentIds = GetAgentIds(model.SpecifiedAgents);

            var finalMobileNos = entity.Core_SendMassSMS(model.AgentClassId, model.AgentTypeId, model.AgentDealId, model.DistrictId, model.ZoneId,
                                                         !string.IsNullOrEmpty(agentIds) ? agentIds : null, model.FreeMobileNo, model.SMSMessage, ts.AppUserId).ToList();

            int counter = 0;

            foreach (var mobileNo in finalMobileNos)
            {
                if (Helpers.SMS.SendSms.Send(mobileNo.MobileNumber, model.SMSMessage, model.Subject))
                {
                    counter++;
                }
            }
            return(counter);
        }