public void UpdataAgentSetting(int id, AgentSettingModel settingmodel, List <AgentServiceProviderNames> model, TravelSession obj) { provider.UpdateAgentwithAgentClass(settingmodel.AgentClassId, obj.AppUserId, id); if (settingmodel.MasterDealIdOfAirlines != 0) { bool result = provider.CheckIFDealExistForAgent(id, 1); if (result == true) { provider.UpdateBranchDistributorAgentSettingDeal(settingmodel, 1, id); } else { provider.SaveBranchDistributorAgentSettingDeal(settingmodel, id, 1, obj.AppUserId); } } else { provider.DeleteBranchDistributorAgentSettingDeal(id, 1); } if (settingmodel.MasterDealIdOfHotel != 0) { bool result = provider.CheckIFDealExistForAgent(id, 2); if (result == true) { provider.UpdateBranchDistributorAgentSettingDeal(settingmodel, 2, id); } else { provider.SaveBranchDistributorAgentSettingDeal(settingmodel, id, 2, obj.AppUserId); } } else { provider.DeleteBranchDistributorAgentSettingDeal(id, 2); } /////////////////Begin Updating Agent Setting Lists ///////////////////////////////////////////// provider.DeleteAgentSetting(id); //// First delete all agent setting/// if (settingmodel.ChkSettingId != null) ////////// Checking if product is other than Ticketing { List <int> AgentSettingIds = new List <int>(); foreach (int sid in settingmodel.ChkSettingId) { AgentSettingIds.Add(sid); } provider.SaveAgentSetting(AgentSettingIds, id); } //// Get Selected Account Setting Of Agent if (model.Count != 0) { model = model.Where(xx => xx.ServiceProviderId != 0).ToList(); provider.DeleteServiceProviderAccountSetting(id); provider.SaveServiceProviderAccountSetting(model, obj.AppUserId, id); } }
public ActionResult Index(int id, AgentSettingModel settingmodel) { try { TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"]; UpdataAgentSetting(id, settingmodel, settingmodel.ServiceProviders, obj); TempData["InfoMessage"] = "Agent Setting Successfully updated"; } catch (Exception ex) { TempData["InfoMessage"] = ex.Message; } return(RedirectToAction("Index")); }
public ActionResult Index(int id, AgentSettingModel settingmodel) { try { TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"]; UpdataAgentSetting(id, settingmodel, settingmodel.ServiceProviders, obj); TempData["InfoMessage"] = "Agent Setting Updated Successfully "; } catch (Exception ex) { TempData["InfoMessage"] = ex.Message; } return(RedirectToAction("AgentList", "BranchOfficeManagement", new { id = settingmodel.branchofficeid })); }
public ActionResult BranchDistributorAgentSetting(int id, AgentSettingModel settingmodel) { try { TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"]; UpdataAgentSetting(id, settingmodel, settingmodel.ServiceProviders, obj); TempData["InfoMessage"] = "Agent Setting Updated Successfully "; } catch (Exception ex) { TempData["InfoMessage"] = ex.Message; } // return RedirectToAction("Index"); return(RedirectToAction("AgentList", new { id = settingmodel.DistributorId })); }
public void SaveBranchDistributorAgentSettingDeal(AgentSettingModel modelTosave, int agentid, int ProductId, int CreatedBy) { Air_AdminBranchDealAssociations datamodel = new Air_AdminBranchDealAssociations(); datamodel.BranchOfficeId = agentid; datamodel.ProductId = ProductId; if (ProductId == 1) { datamodel.DealMasterId = modelTosave.MasterDealIdOfAirlines; } else if (ProductId == 2) { datamodel.DealMasterId = modelTosave.MasterDealIdOfHotel; } datamodel.CreatedBy = CreatedBy; datamodel.CreatedDate = DateTime.Now; entityModel.AddToAir_AdminBranchDealAssociations(datamodel); entityModel.SaveChanges(); }
public void UpdateBranchDistributorAgentSettingDeal(AgentSettingModel model, int ProductID, int AgentId) { Air_AdminBranchDealAssociations tu = entityModel.Air_AdminBranchDealAssociations.Where(u => u.BranchOfficeId == AgentId && u.ProductId == ProductID).FirstOrDefault(); if (tu != null) { if (ProductID == 1) { tu.DealMasterId = model.MasterDealIdOfAirlines; } else if (ProductID == 2) { tu.DealMasterId = model.MasterDealIdOfHotel; } entityModel.ApplyCurrentValues(tu.EntityKey.EntitySetName, tu); entityModel.SaveChanges(); } }
public ActionResult Index(int id, int?BOId) { AgentSettingModel model = new AgentSettingModel(); model.MasterDealIdOfAirlines = provider.GetMasterDeal(id, 1) != null?provider.GetMasterDeal(id, 1).MasterDealId : 0; model.MasterDealIdOfHotel = provider.GetMasterDeal(id, 2) != null?provider.GetMasterDeal(id, 2).MasterDealId : 0; model.MasterDealNameListOfAirlines = provider.GetBranchAllDealListOfAirlines(); model.MasterDealNameListOfHotels = provider.GetAllDealListOfHotel(); model.agentsettinglist = provider.GetAllSettingList(); model.ServiceProviders = provider.GetAllActiveServiceProviders(id).ToList(); model.Activeagentsettinglist = provider.GetAllActiveSettingForAgent(id); ViewData["agentClass"] = new SelectList(provider.GetAgentClass(), "AgentClassId", "AgentClassName"); model.AgentClassId = provider.GetAgentClass(id); model.AgentName = provider.GetAgentName(id); model.branchofficeid = BOId; return(View(model)); }
public ActionResult BranchDistributorAgentSetting(int id, int?DISId) { TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"]; AgentSettingModel model = new AgentSettingModel(); model.MasterDealIdOfAirlines = provider.GetDistributorMasterDeal(DISId ?? 0, 1) != null?provider.GetDistributorMasterDeal(DISId ?? 0, 1).BranchDealMasterId : 0; model.MasterDealIdOfHotel = provider.GetDistributorMasterDeal(DISId ?? 0, 2) != null?provider.GetDistributorMasterDeal(DISId ?? 0, 2).BranchDealMasterId : 0; model.MasterDealNameListOfAirlines = provider.GetAllBranchDistributorDealListOfAirlines(obj.LoginTypeId); model.MasterDealNameListOfHotels = provider.GetAllBranchDistributorDealListOfHotels(obj.LoginTypeId); model.agentsettinglist = provider.GetAllSettingList(); model.ServiceProviders = provider.GetAllActiveServiceProviders(id).ToList(); model.Activeagentsettinglist = provider.GetAllActiveSettingForAgent(id); ViewData["agentClass"] = new SelectList(provider.GetAgentClass(), "AgentClassId", "AgentClassName"); model.AgentClassId = provider.GetAgentClass(id); model.AgentName = provider.GetAgentName(id); model.DistributorId = DISId; return(View(model)); }
public ActionResult Index(int id) { TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"]; AgentSettingModel model = new AgentSettingModel(); model.MasterDealIdOfAirlines = Convert.ToInt32(provider.GetDistributorsAgentMasterDeal(id, 1) != null ? provider.GetDistributorsAgentMasterDeal(id, 1).DistributorDealMasterId : 0); model.MasterDealIdOfHotel = Convert.ToInt32(provider.GetDistributorsAgentMasterDeal(id, 2) != null ? provider.GetDistributorsAgentMasterDeal(id, 2).DistributorDealMasterId : 0); model.MasterDealIdOfBus = Convert.ToInt32(provider.GetDistributorsAgentMasterDeal(id, 4) != null ? provider.GetDistributorsAgentMasterDeal(id, 4).DistributorDealMasterId : 0); model.MasterDealIdOfMobile = Convert.ToInt32(provider.GetDistributorsAgentMasterDeal(id, 3) != null ? provider.GetDistributorsAgentMasterDeal(id, 3).DistributorDealMasterId : 0); model.MasterDealNameListOfAirlines = provider.GetAllDistributorAgentDealListOfAirlines(obj.LoginTypeId); model.MasterDealNameListOfHotels = provider.GetAllDistributorAgentDealListOfHotels(obj.LoginTypeId); model.MasterDealNameListOfBus = provider.GetAllDistributorAgentDealListOfBus(obj.LoginTypeId); model.MasterDealNameListOfMobile = provider.GetAllDistributorAgentDealListOfMobile(obj.LoginTypeId); model.agentsettinglist = provider.GetAllSettingList(); model.ServiceProviders = provider.GetAllActiveServiceProviders(id).ToList(); model.Activeagentsettinglist = provider.GetAllActiveSettingForAgent(id); ViewData["agentClass"] = new SelectList(provider.GetAgentClass(), "AgentClassId", "AgentClassName"); model.AgentClassId = provider.GetAgentClass(id); model.AgentName = provider.GetAgentName(id); return(View(model)); }