public ActionResult userExpectationsView(string Id, string Assesment, string FinYear, string FinQuarter) { eTracLoginModel ObjLoginModel = null; string Employee_Id = string.Empty; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } List <GWCQUestionModel> ListQuestions = new List <GWCQUestionModel>(); try { Employee_Id = Cryptography.GetDecryptedData(Id, true); } catch (Exception e) { Employee_Id = Id; } ListQuestions = _GlobalAdminManager.GetGWCQuestions(Employee_Id, Assesment); foreach (var item in ListQuestions) { item.EEL_FinencialYear = FinYear; item.EEL_FinQuarter = FinQuarter; item.AssessmentType = Assesment; } return(PartialView("userExpectationsView", ListQuestions)); }
//data: { 'Id': item.EMP_EmployeeID, 'Assesment': item.Assesment, 'Name': item.EmployeeName, 'Image': item.EMP_Photo, 'JobTitle': item.JBT_JobTitle }, public ActionResult userEvaluationView(string Id, string Assesment, string Name, string Image, string JobTitle) { eTracLoginModel ObjLoginModel = null; string Employee_Id = string.Empty; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } List <GWCQUestionModel> ListQuestions = new List <GWCQUestionModel>(); try { Employee_Id = Cryptography.GetDecryptedData(Id, true); } catch (Exception e) { Employee_Id = Id; } ListQuestions = _GlobalAdminManager.GetGWCQuestions(Employee_Id, Assesment == "30"?"31":Assesment == "60"?"61":"91"); ViewData["employeeInfo"] = new GWCQUestionModel() { EmployeeName = Name, AssessmentType = Assesment, Image = Image, JobTitle = JobTitle }; return(PartialView("userEvaluationView", ListQuestions)); }
public async Task <IActionResult> LocationDetails(string entity_id, string entity_type) { LocationDetailsModel locationsInfo = new LocationDetailsModel(); string Baseurl = "https://localhost:44326/"; var loactionsResponse = ""; var zomatoApiKey = _config["ZomatoApiKey"]; var latitude = HttpContext.Session.GetString("latitude"); var longitude = HttpContext.Session.GetString("longitude"); if (latitude != null && longitude != null) { using (var client = new HttpClient()) { //Passing service base url client.BaseAddress = new Uri(Baseurl); client.DefaultRequestHeaders.Clear(); //Define request data format client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Add("user-key", zomatoApiKey); //Sending request to find web api REST service resource using HttpClient HttpResponseMessage Res = await client.GetAsync("https://developers.zomato.com/api/v2.1/location_details?entity_id=" + entity_id + "&entity_type=" + entity_type); //Checking the response is successful or not which is sent using HttpClient if (Res.IsSuccessStatusCode) { //Storing the response details recieved from web api loactionsResponse = Res.Content.ReadAsStringAsync().Result; //Deserializing the response recieved from web api and storing into the Model locationsInfo = JsonConvert.DeserializeObject <LocationDetailsModel>(loactionsResponse); } } } return(View(locationsInfo)); }
public List <LocationDetailsModel> GetLocationsList() { List <LocationDetailsModel> list = new List <LocationDetailsModel>(); SqlConnection connection = new SqlConnection(ConfigurationManager.AppSettings["CompetencyAssessmentDB"]); SqlCommand command = new SqlCommand("GetLocationList", connection) { CommandType = CommandType.StoredProcedure }; SqlDataReader reader; try { connection.Open(); reader = command.ExecuteReader(); while (reader.Read()) { LocationDetailsModel locationRecord = new LocationDetailsModel(); locationRecord.LocationId = (int)reader.GetValue(0); locationRecord.Location = reader.GetValue(1).ToString(); list.Add(locationRecord); } reader.Close(); command.Dispose(); connection.Close(); } catch (Exception ex) { Console.WriteLine("Could not get the location details"); } return(list); }
public ActionResult OperationDashboard() { eTracLoginModel ObjLoginModel = null; long Totalrecords = 0; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } //#region WO //UserType _UserType = (WorkOrderEMS.Helper.UserType)ObjLoginModel.UserRoleId; //if (_UserType == UserType.Administrator) // ViewBag.Location = _ICommonMethod.GetLocationByAdminId(ObjLoginModel.UserId); //else if (_UserType == UserType.Manager) // ViewBag.Location = _ICommonMethod.GetLocationByManagerId(ObjLoginModel.UserId); //else //ViewBag.Location = _ICommonMethod.GetAllLocation(); //ViewBag.AssignToUserWO = _GlobalAdminManager.GetLocationEmployeeWO(ObjLoginModel.LocationID); //ViewBag.AssignToUser = _GlobalAdminManager.GetLocationEmployee(ObjLoginModel.LocationID); //ViewBag.Asset = _ICommonMethod.GetAssetList(ObjLoginModel.LocationID); //ViewBag.GetAssetListWO = _ICommonMethod.GetAssetListWO(ObjLoginModel.LocationID); //ViewBag.UpdateMode = false; //ViewBag.PriorityLevel = _ICommonMethod.GetGlobalCodeData("WORKPRIORITY"); //ViewBag.WorkRequestType = _ICommonMethod.GetGlobalCodeData("WORKREQUESTTYPE"); //ViewBag.WorkRequestProjectTypeID = _ICommonMethod.GetGlobalCodeData("WORKREQUESTPROJECTTYPE"); //ViewBag.FacilityRequest = _ICommonMethod.GetGlobalCodeData("FACILITYREQUESTTYPE"); //ViewBag.StateId = _ICommonMethod.GetStateByCountryId(1); //#endregion WO return(PartialView("_OperationDashboard")); }
public async Task <IActionResult> UpdateLocationDetails(LocationDetailsModel locationModel) { if (ModelState.IsValid == false) { return(ValidationProblem()); } await _locationsService.UpdateAsync(locationModel); return(NoContent()); }
/// <summary> /// A temporary solution for checking existing address. /// Read repo needs to add another way of allowing a look up as this will be very expensive /// In addition a better implementation should be implemented here. /// </summary> /// <param name="locationDetailsModel"></param> /// <returns></returns> private async Task <Guid> GetLocationIdOrDefault(LocationDetailsModel locationDetailsModel) { IEnumerable <LocationDetailsModel> existingLocations = await _readLocationDetailsRepository.Get(); var location = existingLocations.FirstOrDefault(x => x.Address.Postalcode1 == locationDetailsModel.Address.Postalcode1 && x.Address.Postalcode2 == locationDetailsModel.Address.Postalcode2 && x.Address.LineOne == locationDetailsModel.Address.LineOne); return(location == null ? default(Guid) : location.Id); }
public ActionResult ePeopleDashboard() { eTracLoginModel ObjLoginModel = null; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } return(PartialView("_ePeopleDashboard")); }
public ActionResult PerformanceManagementGrid() { eTracLoginModel ObjLoginModel = null; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } return(PartialView("_306090Grid")); }
public ActionResult HiringOnBoardingDashboard() { eTracLoginModel ObjLoginModel = null; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } return(PartialView("~/Views/NewAdmin/ePeople/_HiringOnBoardingDashboard.cshtml")); }
public ActionResult OperationReports() { eTracLoginModel ObjLoginModel = null; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } return(PartialView("~/Views/NewAdmin/_Reports.cshtml")); }
public ActionResult EMaintananceDashboard() { eTracLoginModel ObjLoginModel = null; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } return(PartialView("~/Views/NewAdmin/WorkOrderView/_WorkOrderDashboard.cshtml")); }
public async Task UpdateAsync(LocationDetailsModel locationModel) { var sqlModel = new SqlParamsModel { Sql = "pkg_locations.p_update_location", Parameters = new OracleDynamicParameters() }; sqlModel.Parameters.Add("pi_location_id", locationModel.LocationId, dbType: OracleMappingType.Int32, ParameterDirection.Input); sqlModel.Parameters.Add("pi_location_name", locationModel.LocationName, dbType: OracleMappingType.Varchar2, ParameterDirection.Input); await _dataAccess.ExecuteAsync(sqlModel); }
public async Task <ActionResult <LocationDetailsModel> > GetLocationDetails(int locationId) { if (locationId < 0) { return(UnprocessableEntity($"Invalid LocationId: {locationId}")); } LocationDetailsModel locationDetails = await _locationsService.RetrieveAsync(locationId); if (locationDetails is null) { return(NotFound()); } return(Ok(locationDetails)); }
public ActionResult DisplayLocationData(int LocationId, int?rows = 20, int?page = 1, int?TotalRecords = 10, string sord = null, String sidx = null, string txtSearch = null) { eTracLoginModel ObjLoginModel = null; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); if (LocationId == null) { LocationId = Convert.ToInt32(ObjLoginModel.LocationID); } } try { sord = string.IsNullOrEmpty(sord) ? "desc" : sord; sidx = string.IsNullOrEmpty(sidx) ? "LocationId" : sidx; var obj_Common_B = new Common_B(); ObjectParameter paramTotalRecords = new ObjectParameter("TotalRecords", typeof(int)); var data = _GlobalAdminManager.LocationDetailByLocationID(LocationId); if (data.Count() > 0) { var ListLocationModel = new ListLocationModel(); var serivces = obj_Common_B.GetLocationServicesByLocationID(LocationId, 0); foreach (var locList in data) { //var id = Cryptography.GetEncryptedData(locList.LocationId.ToString(), true); ListLocationModel.LocationName = locList.LocationName; ListLocationModel.Address = locList.Address1 + "," + locList.Address2; ListLocationModel.City = locList.City; ListLocationModel.State = locList.LocationState; ListLocationModel.Country = locList.LocationCountry; ListLocationModel.Mobile = locList.PhoneNo + " / " + locList.Mobile; ListLocationModel.Description = locList.Description; ListLocationModel.ZipCode = locList.ZipCode; ListLocationModel.LocationSubTypeDesc = locList.LocationSubTypeDesc; //ListLocationModel.LocationCode = locList.Loc; ListLocationModel.LocationServices = serivces; } details.ListLocationModel = ListLocationModel; } } catch (Exception ex) { } return(View(details)); }
public async Task GetLocationDetails_NotFound() { // Arrange int locationId = 1; LocationDetailsModel expected = null; _mockLocationsService.RetrieveAsync(locationId).Returns(expected); // Act ActionResult <LocationDetailsModel> response = await _sut.GetLocationDetails(locationId); // Assert await _mockLocationsService.Received(1).RetrieveAsync(locationId); Assert.IsType <NotFoundResult>(response.Result); }
public async Task <IEnumerable <LocationDetailsModel> > GetDetails(int lgaId, string startDate, string endDate) { List <Enrollee> maleEnrollees = new List <Enrollee>(); List <Enrollee> femaleEnrollees = new List <Enrollee>(); List <Location> locations = new List <Location>(); List <LocationDetailsModel> locationDetailsModels = new List <LocationDetailsModel>(); if (lgaId == 0) { locations = _context.Locations.ToList(); } else { var location = _context.Locations.Find(lgaId); locations.Add(location); } foreach (var item in locations) { int enrolleesCount = 0; LocationDetailsModel detailsModel = new LocationDetailsModel { LgaId = item.Id, LgaName = item.Name }; var hospitals = (List <Hospital>) await _hospitalService.GetHospitalByLocationId(item.Id); detailsModel.HospitalCount = hospitals.Count; foreach (var hospital in hospitals) { enrolleesCount += hospital.Enrollees.Count; } detailsModel.EnrolleesCount = enrolleesCount; maleEnrollees = (List <Enrollee>) await _enrolleeService.FindEnrolleeByGender("male", item.Id, Convert.ToDateTime(startDate), Convert.ToDateTime(endDate)); detailsModel.MaleEnrolleesCount = maleEnrollees.Count; femaleEnrollees = (List <Enrollee>) await _enrolleeService.FindEnrolleeByGender("female", item.Id, Convert.ToDateTime(startDate), Convert.ToDateTime(endDate)); detailsModel.FemaleEnrolleesCount = femaleEnrollees.Count; locationDetailsModels.Add(detailsModel); } return(locationDetailsModels); }
public async Task HandleAsync(PartnersPaymentTokensReservedEvent msg) { // TODO: implement deduplication later var senderResponse = await _customerProfileClient.CustomerProfiles.GetByCustomerIdAsync(msg.CustomerId); var sender = senderResponse?.Profile; string partnerName = null; LocationDetailsModel location = null; if (!string.IsNullOrWhiteSpace(msg.LocationId)) { if (Guid.TryParse(msg.LocationId, out var locId)) { var partner = await _partnerManagementClient.Partners.GetByLocationIdAsync(locId); partnerName = partner?.Name; location = partner?.Locations.FirstOrDefault(l => l.Id == locId); } else { _log.Warning($"Couldn't parse location id {msg.LocationId} as GUID"); } } await _reportHelper.AddAsync( new TransactionReport { Id = msg.PaymentRequestId, Timestamp = msg.Timestamp, TransactionType = TxType, Status = TxStatus.Reserved.ToString(), Vertical = Vertical.Hospitality.ToString(), TransactionCategory = TxCategory.Redemption.ToString(), Amount = msg.Amount, SenderName = $"{sender?.FirstName} {sender?.LastName}", SenderEmail = sender?.Email, ReceiverName = partnerName, LocationInfo = location?.Name, LocationExternalId = location?.ExternalId, LocationIntegrationCode = location?.AccountingIntegrationCode, } ); }
public async Task GetLocationDetails_Valid() { // Arrange int locationId = 1; LocationDetailsModel expected = GetSampleData().FirstOrDefault(x => x.LocationId == locationId); _mockLocationsService.RetrieveAsync(locationId).Returns(expected); // Act ActionResult <LocationDetailsModel> response = await _sut.GetLocationDetails(locationId); // Assert await _mockLocationsService.Received(1).RetrieveAsync(locationId); var createdAtActionResult = Assert.IsType <OkObjectResult>(response.Result); LocationDetailsModel actual = (LocationDetailsModel)createdAtActionResult.Value; Assert.True(actual is not null); Assert.Equal(expected.LocationId, actual.LocationId); Assert.Equal(expected.LocationName, actual.LocationName); }
public ActionResult Location(Guid id, QueryModel oq, QueryModel cq, bool?showOpen) { IPagedList <ClosedWorkOrderModel> closedOrders = _workOrderService.GetLocationClosedWorkOrdersModels(cq, id); IPagedList <OpenWorkOrderModel> openOrders = _workOrderService.GetLocationOpenWorkOrdersModels(oq, id); LocationAddressModel location = _workOrderService.GetLocationInfo(id); LocationInfoModel locationInfo = _workOrderService.GetSpecificLocationInfo(id); var locationItems = _locationService.GetSingleLocation(id).Select(l => new SelectListItem { Value = l.Id.ToString(), Text = l.Name }).ToList(); locationItems.Insert(0, new SelectListItem()); var model = new LocationDetailsModel(Url) { LocationOpenOrders = openOrders, LocationClosedOrders = closedOrders, ShowOpen = showOpen ?? true, Locations = locationItems, ClosedWorkOrdersQuery = cq, OpenWorkOrdersQuery = oq, Address1 = location.Address1, Address2 = location.Address2, City = location.City, State = location.State, PostalCode = location.PostalCode, Name = location.Name, LocationInfo = locationInfo, LocationAddress = location }; ViewData["ReturnToListUrl"] = TempData.ContainsKey("ReturnToListUrl") ? TempData["ReturnToListUrl"] : Url.Action("Index"); return(View(model)); }
public ActionResult userAssessmentView(string Id, string Assesment) { eTracLoginModel ObjLoginModel = null; string Employee_Id = string.Empty; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } List <GWCQUestionModel> ListQuestions = new List <GWCQUestionModel>(); try { Employee_Id = Cryptography.GetDecryptedData(Id, true); } catch (Exception e) { Employee_Id = Id; } ListQuestions = _GlobalAdminManager.GetGWCQuestions(Employee_Id, Assesment); return(PartialView("userAssessmentView", ListQuestions)); }
public Task <HttpResponseMessage> UpdateLocationAsync(LocationDetailsModel locationDetails) { return(_http.PutAsJsonAsync(locationBaseUrl, locationDetails)); }