// *********************************************************************************** ////// Setting of session For Specific user login // *********************************************************************************** public void SetSessionsObject(Guid userId) { Agents ainfo = null; TravelSession obj = new TravelSession(); aspnet_Users tu = GetUserInfo(userId); try { ainfo = GetAgentInfo(tu.UserId); } catch (Exception) { } UsersDetails udinfo = GetUserDetailsInfo(userId); if (udinfo.UserTypeId == 5) { BranchOfficeManagementProvider branchOfficeManagementProvider = new BranchOfficeManagementProvider(); View_BranchDetails branchOffices = branchOfficeManagementProvider.GetBranchOfficeByUserId(userId); obj.LoginTypeName = branchOffices.BranchOfficeName; obj.AgentCode = branchOffices.BranchOfficeName; obj.LoginTypeId = branchOffices.BranchOfficeId; } else if (udinfo.UserTypeId == 6) { DistributorManagementProvider distributorManagementProvider = new DistributorManagementProvider(); View_DistributorDetails distributors = distributorManagementProvider.GetDistributorByUserId(userId); obj.LoginTypeName = distributors.DistributorName; obj.AgentCode = distributors.DistributorName; obj.LoginTypeId = distributors.DistributorId; } else if (udinfo.UserTypeId == 7) { obj.Id = userId; obj.LoginName = tu.UserName; obj.AppUserId = udinfo.AppUserId; obj.UserTypeId = udinfo.UserTypeId; obj.ProductId = GetUserProductId(obj.AppUserId); } obj.Id = userId; obj.LoginName = tu.UserName; obj.AppUserId = udinfo.AppUserId; obj.UserTypeId = udinfo.UserTypeId; obj.ProductId = GetUserProductId(obj.AppUserId); HttpContext.Current.Session["TravelPortalSessionInfo"] = obj; }
public BranchOfficeManagementModel BranchOfficeManagementDetail(int BranchOfficeId) { BranchOffices result = ent.BranchOffices.Where(x => x.BranchOfficeId == BranchOfficeId).FirstOrDefault(); View_AgentDetails Agentadmindetails = _agentdetailsprovider.GetAgentAdminUser(BranchOfficeId); BranchOfficeManagementModel model = new BranchOfficeManagementModel(); model.BranchOfficeId = result.BranchOfficeId; model.BranchOfficeId = result.BranchOfficeId; model.BranchOfficeCode = result.BranchOfficeCode; model.BranchOffice = result.BranchOfficeName; model.NativeCountry = result.NativeCountryId; model.NativeCountryName = result.Countries.CountryName; model.Zone = result.ZoneId; model.ZoneName = result.Zones.ZoneName; model.District = result.DistrictId; model.DistrictName = result.Districts.DistrictName; model.Address = result.Address; model.Phone = result.Phone; model.Email = result.Email; model.Fax = result.FaxNo; model.PanNo = result.PanNo; model.Web = result.Web; model.status = Convert.ToInt32(result.Status); model.TimeZone = result.TimeZoneId; model.isSystem = result.isSystem; model.CreatedBy = result.CreatedBy; model.CreatedDate = result.CreatedDate; model.UpdatedBy = result.UpdatedBy; model.UpdatedDate = result.UpdatedDate; View_BranchDetails BranchUserDetail = GetBranchUserDetails(BranchOfficeId); if (BranchUserDetail != null) { model.FullName = BranchUserDetail.FullName; model.UserName = BranchUserDetail.UserName; model.UserEmail = BranchUserDetail.Email; model.UserAddress = BranchUserDetail.UserAddress; model.UserPhone = BranchUserDetail.Phone; model.MobileNo = BranchUserDetail.MobileNumber; model.Password = BranchUserDetail.Password; model.ConfirmPassword = BranchUserDetail.Password; } return(model); }
public bool CheckEditDuplicateMobileNumber(string MobileNumber, int BranchUserId) { View_BranchDetails View_BranchDetails = ent.View_BranchDetails.Where(ii => ii.BranchOfficeId == BranchUserId).FirstOrDefault(); if (View_BranchDetails != null) { UsersDetails usersDetails = ent.UsersDetails.Where(ii => ii.MobileNumber == MobileNumber && ii.UserId != View_BranchDetails.UserId).FirstOrDefault(); if (usersDetails != null) { return(false); } else { return(true); } } return(false); }
public View_BranchDetails GetBranchUserDetails(int BranchOfficeId) { View_BranchDetails BranchUserDetails = ent.View_BranchDetails.Where(uu => (uu.BranchOfficeId == BranchOfficeId && uu.UserTypeId == 5)).FirstOrDefault(); return(BranchUserDetails); }