List <M_BillingAddress> ICustomerDA.GetAllAddress(SearchAddress address) { try { DataTable dt = new DataTable(); if (connString.State == ConnectionState.Closed) { connString.Open(); } cmd = new SqlCommand("uspGetCustomerAddress", connString); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CustomerId", address.CustomerId); cmd.Parameters.AddWithValue("@AddressId", address.AddressId); cmd.Parameters.AddWithValue("@Pincode", ""); cmd.Parameters.AddWithValue("@AddressType", address.AddressType); cmd.Parameters.AddWithValue("@IsDefault", address.IsDefault); SqlDataAdapter sda = new SqlDataAdapter(cmd); sda.Fill(dt); sda.Dispose(); return(ExtensionMethods.ConvertToListOf <M_BillingAddress>(dt)); } catch (Exception ex) { return(null); } finally { connString.Close(); } }
public async Task <IEnumerable <Address> > SearchAddress(SearchAddress Searchaddress, string clientKey = null, string apiKey = null) { List <Address> AddressList = new List <Address>(); try { configuration.ClientURL = @ServerApi.URL_AuthGateway; if ((!string.IsNullOrEmpty(clientKey) && !string.IsNullOrEmpty(apiKey))) { configuration.Client.Authenticator = new HttpBasicAuthenticator(clientKey, apiKey); } configuration.RequestURL = $"SearchAddress"; configuration.Client = new RestClient($"{configuration.ClientURL}"); configuration.Request = new RestRequest($"{configuration.RequestURL}", Method.POST, DataFormat.Json); configuration.Request.AddJsonBody(Searchaddress); var response = configuration.Client.Execute <List <Address> >(configuration.Request); return(response.Data); } catch (Exception ex) { Debug.WriteLine($"An error occured when request to API: {ex.Message}"); } return(await Task.FromResult(AddressList)); }
// Edit a property by searching address internal void EditAPropertyBySearchAddress() { try { //Edit name textbox PropertyName.Clear(); Thread.Sleep(1000); PropertyName.SendKeys("BHouse"); //SearchAddress SearchAddress.SendKeys("77"); Thread.Sleep(1000); SearchAddress.SendKeys(Keys.ArrowDown); SearchAddress.SendKeys(Keys.Enter); Thread.Sleep(1000); //Edit description textbox Description.Clear(); Thread.Sleep(1000); Description.SendKeys("Beautiful House"); //Click on the "Save" button SaveButton.Click(); Thread.Sleep(2000); } catch (Exception e) { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Test Failed, Edit Unsuccessfull", e.Message); } }
//GET: Address/Search public ActionResult Search(string address) { var addressSearch = new SearchAddress(); var foundAddresses = addressSearch.Find(address); return(View(foundAddresses)); }
public void AddPropertyDetails() { obj.ClickAddNewProperty(); // Populating the data from Excel ExcelLib.PopulateInCollection(Base.ExcelPath, "PropertyDetails"); PropertyName.SendKeys(ExcelLib.ReadData(2, "PropertyName")); SearchAddress.SendKeys(ExcelLib.ReadData(2, "SearchAddress")); Description.SendKeys(ExcelLib.ReadData(2, "Description")); Number.SendKeys(ExcelLib.ReadData(2, "Number")); Street.SendKeys(ExcelLib.ReadData(2, "Street")); Suburb.SendKeys(ExcelLib.ReadData(2, "Suburb")); City.SendKeys(ExcelLib.ReadData(2, "City")); PostCode.SendKeys(ExcelLib.ReadData(2, "PostCode")); Region.SendKeys(ExcelLib.ReadData(2, "Region")); YearBuilt.SendKeys(ExcelLib.ReadData(2, "YearBuilt")); TargetRent.SendKeys(ExcelLib.ReadData(2, "TargetRent")); LandArea.SendKeys(ExcelLib.ReadData(2, "LandArea")); FloorArea.SendKeys(ExcelLib.ReadData(2, "FloorArea")); BedRooms.SendKeys(ExcelLib.ReadData(2, "Bedrooms")); BathRooms.SendKeys(ExcelLib.ReadData(2, "Bathrooms")); CarPark.SendKeys(ExcelLib.ReadData(2, "Carparks")); owneroccupied = ExcelLib.ReadData(2, "Owner Occupied"); if (owneroccupied == "Yes") { OwnerOccupied.Click(); } Next.Click(); AddFinanceDetails(); }
//Adding Repayment,Expenses and Liabilities internal void RepaymentExpensesLiabilities() { //To skip the highlighted option SkipButton?.Click(); System.Threading.Thread.Sleep(5000); // Populating the data from Excel ExcelLib.PopulateInCollection(Base.ExcelPath, "AddNewProperty"); OwnersSelect.Click(); System.Threading.Thread.Sleep(5000); PropertiesSelect.Click(); ClickingAddNewProperty.Click(); //Value set for property page details PropertyName.SendKeys(ExcelLib.ReadData(2, "Value")); SearchAddress.SendKeys(ExcelLib.ReadData(33, "Value")); System.Threading.Thread.Sleep(5000); //Value set using google api var address = Global.Driver.driver.FindElements(By.ClassName("pac-item"))[0]; address.Click(); TargetRent.SendKeys(ExcelLib.ReadData(14, "Value")); LandArea.SendKeys(ExcelLib.ReadData(10, "Value")); BedRooms.SendKeys(ExcelLib.ReadData(11, "Value")); CarParks.SendKeys(ExcelLib.ReadData(12, "Value")); Description.SendKeys(ExcelLib.ReadData(13, "Value")); FloorArea.SendKeys(ExcelLib.ReadData(15, "Value")); BathRooms.SendKeys(ExcelLib.ReadData(16, "Value")); YearBuilt.SendKeys(ExcelLib.ReadData(9, "Value")); NextButton.Click(); //Value set for financial details page System.Threading.Thread.Sleep(2000); PurchasePrice.SendKeys(ExcelLib.ReadData(17, "Value")); HomeValue.SendKeys(ExcelLib.ReadData(18, "Value")); Mortgage.SendKeys(ExcelLib.ReadData(19, "Value")); //Adding repayment option AddRepayment.Click(); RepaymentAmount.SendKeys(ExcelLib.ReadData(2, "AddRepaymentfieldValue")); RepaymentStartDate.SendKeys(ExcelLib.ReadData(3, "AddRepaymentfieldValue")); //Adding expenses option AddExpense.Click(); ExpenseAmount.SendKeys(ExcelLib.ReadData(2, "AddExpensefieldValue")); var ExpenseDescription = Global.Driver.driver.FindElement(By.ClassName("seven")).FindElement(By.ClassName("width")).FindElement(By.Id("Text1")); ExpenseDescription.SendKeys(ExcelLib.ReadData(3, "AddExpensefieldValue")); ExpenseDate.SendKeys(ExcelLib.ReadData(4, "AddExpensefieldValue")); NextButton2.Click(); //Value set for financial details page TenantEmail.SendKeys(ExcelLib.ReadData(20, "Value")); FirstName.SendKeys(ExcelLib.ReadData(21, "Value")); LastName.SendKeys(ExcelLib.ReadData(22, "Value")); StartDate.SendKeys(ExcelLib.ReadData(23, "Value")); EndDate.SendKeys(ExcelLib.ReadData(24, "Value")); RentAmount.SendKeys(ExcelLib.ReadData(25, "Value")); PaymentStartDate.SendKeys(ExcelLib.ReadData(26, "Value")); //Adding liability option NewLiability.Click(); Amount.SendKeys(ExcelLib.ReadData(2, "NewLiabilityFieldValue")); Save.Click(); }
List <M_BillingAddress> ICustomer.GetAllAddress(SearchAddress address) { try { return(icustomer.GetAllAddress(address)); } catch (Exception ex) { return(null); } }
public async Task <ActionResult <SearchAddress> > SearchAddress([FromQuery] string address, string sortby = "alphabetical") { List <AddressEntity> addressList = new List <AddressEntity>(); List <SearchAddress> addressSearchResult = new List <SearchAddress>(); try { if (address.Length >= 3) { var query = context.Addresses.Where(x => (x.Address.Contains(address) || x.City.Contains(address) || x.State.Contains(address))); addressList = await query.ToListAsync(); if (addressList.Count > 0) { foreach (var adrs in addressList) { var totalfrequency = 0; totalfrequency = frequency(address, adrs.Address) + frequency(address, adrs.City) * 2 + frequency(address, adrs.State) * 3; var obj = new SearchAddress { Address = adrs.Address, City = adrs.City, State = adrs.State, frequency = totalfrequency }; addressSearchResult.Add(obj); } if (!string.IsNullOrEmpty(sortby)) { if (sortby == "alphabetical") { return(Ok(addressSearchResult.OrderBy(x => x.Address))); } if (sortby == "frequency") { return(Ok(addressSearchResult.OrderByDescending(x => x.frequency))); } } } else { return(NotFound()); } } } catch (Exception e) { return(Ok(addressSearchResult)); } return(Ok(addressSearchResult)); }
//A method to enter and save a given test data set for property details internal bool SavePropertyDetails(int TestDataSet) { try { //A variable that contains the search address used for the Google API string SearchAddressString; SearchAddressString = ExcelLib.ReadData(TestDataSet, "Number") + " " + ExcelLib.ReadData(TestDataSet, "Street") + " " + ExcelLib.ReadData(TestDataSet, "Suburb") + " " + ExcelLib.ReadData(TestDataSet, "City") + " " + ExcelLib.ReadData(TestDataSet, "PostCode") + " " + ExcelLib.ReadData(TestDataSet, "City"); //Enter the testdata into the relevant input fields PropertyName.SendKeys(ExcelLib.ReadData(TestDataSet, "Property Name")); Description.SendKeys(ExcelLib.ReadData(TestDataSet, "Description")); //Using the Google API search results to populate the address fields SearchAddress.SendKeys(SearchAddressString); Thread.Sleep(1000); SearchAddress.SendKeys(Keys.Down); SearchAddress.SendKeys(Keys.Enter); TargetRent.SendKeys(ExcelLib.ReadData(TestDataSet, "TargetRent")); Bedrooms.SendKeys(ExcelLib.ReadData(TestDataSet, "Bedrooms")); Bathrooms.SendKeys(ExcelLib.ReadData(TestDataSet, "Bathrooms")); Carparks.SendKeys(ExcelLib.ReadData(TestDataSet, "Carparks")); YearBuilt.SendKeys(ExcelLib.ReadData(TestDataSet, "YearBuilt")); //Finding the path of the Image String ImagePath = Keys_Resource.ImagePath; ImagePath = ImagePath + ExcelLib.ReadData(TestDataSet, "Photo"); //Upload the photo of the property from file FileUploadButton.SendKeys(ImagePath); Thread.Sleep(5000); //Click on the Next Button to move on to the Next Section PropertyNextButton.Click(); Thread.Sleep(1000); return(true); } catch (Exception e) { // Log the error details in the report Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Error, "Error occured when entering property details for the new property: " + e.Message.ToString()); // Save Screenshot to display the error String img = SaveScreenShotClass.SaveScreenshot(Driver.driver, "Exception Report"); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Image example: " + img); return(false); } }
//Add new property internal void AddingProperty() { //To skip the highlighted option SkipButton?.Click(); System.Threading.Thread.Sleep(5000); // Populating the data from Excel ExcelLib.PopulateInCollection(Base.ExcelPath, "AddNewProperty"); System.Threading.Thread.Sleep(5000); OwnersSelect.Click(); System.Threading.Thread.Sleep(5000); PropertiesSelect.Click(); ClickingAddNewProperty.Click(); //Value set for property details page PropertyName.SendKeys(ExcelLib.ReadData(2, "Value")); SearchAddress.SendKeys(ExcelLib.ReadData(33, "Value")); System.Threading.Thread.Sleep(5000); //Value set using google api var address = Global.Driver.driver.FindElements(By.ClassName("pac-item"))[0]; address.Click(); TargetRent.SendKeys(ExcelLib.ReadData(14, "Value")); LandArea.SendKeys(ExcelLib.ReadData(10, "Value")); BedRooms.SendKeys(ExcelLib.ReadData(11, "Value")); CarParks.SendKeys(ExcelLib.ReadData(12, "Value")); Description.SendKeys(ExcelLib.ReadData(13, "Value")); FloorArea.SendKeys(ExcelLib.ReadData(15, "Value")); BathRooms.SendKeys(ExcelLib.ReadData(16, "Value")); YearBuilt.SendKeys(ExcelLib.ReadData(9, "Value")); imagebox.Click(); //Image upload Global.Driver.driver.FindElement(By.Id("file-upload")).Click(); System.Threading.Thread.Sleep(10000); SendKeys.SendWait("E:\\Document\\house.jpg"); System.Threading.Thread.Sleep(10000); SendKeys.SendWait(@"{Enter}"); System.Threading.Thread.Sleep(5000); NextButton.Click(); System.Threading.Thread.Sleep(5000); //Value set for financial details page PurchasePrice.SendKeys(ExcelLib.ReadData(17, "Value")); HomeValue.SendKeys(ExcelLib.ReadData(18, "Value")); Mortgage.SendKeys(ExcelLib.ReadData(19, "Value")); NextButton2.Click(); //Value set for Tenant details page TenantEmail.SendKeys(ExcelLib.ReadData(20, "Value")); FirstName.SendKeys(ExcelLib.ReadData(21, "Value")); LastName.SendKeys(ExcelLib.ReadData(22, "Value")); StartDate.SendKeys(ExcelLib.ReadData(23, "Value")); EndDate.SendKeys(ExcelLib.ReadData(24, "Value")); RentAmount.SendKeys(ExcelLib.ReadData(25, "Value")); PaymentStartDate.SendKeys(ExcelLib.ReadData(26, "Value")); Save.Click(); }
/// <summary> /// Creates a new instance. /// </summary> /// <param name="locator">The DeviceLocator class to use for bus access.</param> /// <param name="delayTime">Minimum time to wait before requesting the next bus assertion. /// <param name="onlyDevicesWithoutAddress">If true, then the /// RequestBusAssertionIfNoAddress broadcast is used to address only devices which do not /// have a valid bus address.</param> /// Choose this delay according to the processing time of the bus devices.</param> public BinaryAddressSearcher(DeviceLocator locator, double delayTime = 5e-3, bool onlyDevicesWithoutAddress = false) { DelayTime = delayTime; OnlyDevicesWithoutAddress = onlyDevicesWithoutAddress; addressesToSearch = new List <SearchAddress> { (SearchAddress.GetStartSearchAddress()) }; Devices = new List <uint>(); deviceLocator = locator; timer.Start(); }
public (SearchAddress detectedDevice, SearchAddress nextLevelAddresses, SearchAddress sameLevelAddress) GetNextAddresses(bool foundThisAddress) { SearchAddress nextLevelAddresses = null; SearchAddress sameLevelAddress = null; SearchAddress detectedDevice = null; if (Level == 0) { if (foundThisAddress) { nextLevelAddresses = new SearchAddress(Address, Level + 1); } } else { bool leftBranch = (Address & (uint)(1 << (Level - 1))) == 0; if (foundThisAddress) { var oneLevelDeeper = new SearchAddress(Address, Level + 1); if (oneLevelDeeper.Found) { detectedDevice = oneLevelDeeper; } else { nextLevelAddresses = oneLevelDeeper; } if (leftBranch) { sameLevelAddress = new SearchAddress(Address | (uint)(1 << (Level - 1)), Level); // sibling on same level } } else if (leftBranch) { var oneLevelDeeper = new SearchAddress(Address | (uint)(1 << (Level - 1)), Level + 1); // sibling one level deeper if (oneLevelDeeper.Found) { detectedDevice = oneLevelDeeper; } else { nextLevelAddresses = oneLevelDeeper; } } } return(detectedDevice, nextLevelAddresses, sameLevelAddress); }
public async Task <HttpResponseMessage> GetAllAddress([FromBody] SearchAddress address) { try { List <M_BillingAddress> customer = new List <M_BillingAddress>(); await Task.Run(() => { customer = icustomer.GetAllAddress(address); }); if (customer != null) { return(Request.CreateResponse(HttpStatusCode.OK, customer)); } else { return(Request.CreateResponse(HttpStatusCode.NotFound, new { StatusCode = HttpStatusCode.NotFound, Status = "Failed" })); } } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public async Task <ActionResult> UpdateProfile([Bind] Profile profile, string clientKey = null, string secretKey = null) { Profile model = new Profile(); ViewBag.IsAlertResponse = false; ViewBag.ActivityResponsMessage = null; var identity = (ClaimsPrincipal)Thread.CurrentPrincipal; var userName = identity.Claims.Where(c => c.Type == ClaimTypes.Name) .Select(c => c.Value).SingleOrDefault(); //side menu validasi var fetchingProfileList = await reader.SearchProfileIndex(userName); var role = fetchingProfileList.Data.FirstOrDefault(x => x.RoleID == x.RoleID)?.RoleID; ViewBag.roleID = role; var DateRequest = profile.DOB; var time = DateTime.Now.ToString("hh:mm:ss"); string format = "MM/dd/yyyy"; CultureInfo provider = CultureInfo.InvariantCulture; var date = DateTime.ParseExact(DateRequest, format, provider); var dateFinal = Convert.ToDateTime(date).ToString("yyyy-MM-ddThh:mm:ss.549Z").Substring(0, 10) + "T" + time + ".549Z"; var item = new Profile(); if (role == "4") { item = new Profile() { //CallItemDate = Convert.ToDateTime(date).ToString("yyyy-MM-ddThh:mm:ss.549Z"), Email = profile.Email, FullName = profile.FullName, ProfileID = profile.ProfileID, RoleID = "0", CreateDate = dateFinal, Username = userName, Profession = profile.Profession, DOB = dateFinal, Gender = profile.Gender, Phone = profile.Phone, CoverImage = profile.CoverImage, ProfileImage = profile.ProfileImage, Experience = profile.Experience, Jabatan = profile.Jabatan, Qualification = profile.Qualification, Type = profile.Type, SalaryRange = profile.SalaryRange, Setyourprofile = profile.Setyourprofile, AboutSelf = profile.AboutSelf, JobTitle = profile.JobTitle, SectorID = profile.SectorID, AddID = profile.AddID, PostalCode = profile.PostalCode, FullAddress = profile.FullAddress, CompanyName = "-", IsActive = profile.IsActive, }; } else if (role == "5") { item = new Profile() { //CallItemDate = Convert.ToDateTime(date).ToString("yyyy-MM-ddThh:mm:ss.549Z"), Email = profile.Email, FullName = profile.FullName, ProfileID = profile.ProfileID, RoleID = "0", CreateDate = dateFinal, Username = userName, Profession = "-", DOB = dateFinal, Gender = "-", Phone = profile.Phone, CoverImage = profile.CoverImage, ProfileImage = profile.ProfileImage, Experience = "-", Jabatan = "-", Qualification = "-", Type = "-", SalaryRange = "-", Setyourprofile = profile.Setyourprofile, AboutSelf = profile.AboutSelf, JobTitle = "-", SectorID = profile.SectorID, AddID = profile.AddID, PostalCode = profile.PostalCode, FullAddress = profile.FullAddress, CompanyName = profile.CompanyName, IsActive = profile.IsActive, }; } else { item = new Profile() { Email = profile.Email, FullName = profile.FullName, ProfileID = profile.ProfileID, RoleID = "0", CreateDate = dateFinal, Username = userName, Profession = profile.Profession, DOB = dateFinal, Gender = profile.Gender, Phone = profile.Phone, CoverImage = profile.CoverImage, ProfileImage = profile.ProfileImage, Experience = profile.Experience, Jabatan = profile.Jabatan, Qualification = profile.Qualification, Type = profile.Type, SalaryRange = profile.SalaryRange, Setyourprofile = profile.Setyourprofile, AboutSelf = profile.AboutSelf, JobTitle = profile.JobTitle, SectorID = profile.SectorID, AddID = profile.AddID, PostalCode = profile.PostalCode, FullAddress = profile.FullAddress, CompanyName = profile.CompanyName, IsActive = profile.IsActive, }; } var result = await writer.UpdateProfile(item, clientKey, secretKey); if (result.Item2) { ViewBag.IsAlertResponse = true; var responser = new ActivityResponsMessage() { Message = "The data has been updated successfully!", RequestTime = DateTime.Now, ResponseTime = DateTime.Now, Type = "success" }; ViewBag.ActivityResponsMessage = responser; } else { ViewBag.IsAlertResponse = true; var responser = new ActivityResponsMessage() { Message = "Opss.. Failed to update item!", RequestTime = DateTime.Now, ResponseTime = DateTime.Now, Type = "error" }; ViewBag.ActivityResponsMessage = responser; } //balikin data get atau panggil method get //Get dropdown list gender string genderString = "Laki-laki,Wanita"; IEnumerable <GenderProfile> Infogender = from name in genderString.Split(',') select new GenderProfile() { Gender = name, NameGender = name }; List <GenderProfile> listGender = Infogender.ToList(); ViewBag.GenderList = listGender; //Get dropdown list Experience string experienceString = "Fresh Graduate,1 Tahun,2 Tahun,3 Tahun,4 Tahun,5 Tahun"; IEnumerable <ExperienceProfile> Infoexperience = from name in experienceString.Split(',') select new ExperienceProfile() { Experience = name, NameExperience = name }; List <ExperienceProfile> listExp = Infoexperience.ToList(); ViewBag.ExpList = listExp; //Get dropdown list Qualification string QualificationString = "SMK/SMA,Diploma 1,Diploma 2,Diploma 3,Sarjana 1,Sarjana 2,Sarjana 3"; IEnumerable <QualificationProfile> InfoQualification = from name in QualificationString.Split(',') select new QualificationProfile() { Qualification = name, NameQualification = name }; List <QualificationProfile> listQualification = InfoQualification.ToList(); ViewBag.QualificationList = listQualification; //Get dropdown list Jabatan string JabatanString = "Staff,Manager,Supervisor"; IEnumerable <JabatanProfile> InfoJabatan = from name in JabatanString.Split(',') select new JabatanProfile() { Jabatan = name, NameJabatan = name }; List <JabatanProfile> listJabatan = InfoJabatan.ToList(); ViewBag.JabatanList = listJabatan; //Get dropdown list Type string TypeString = "Freelance,Kontrak,Paruh Waktu,Penuh Waktu"; IEnumerable <TypeProfile> InfoType = from name in TypeString.Split(',') select new TypeProfile() { Type = name, NameType = name }; List <TypeProfile> listType = InfoType.ToList(); ViewBag.TypeList = listType; //Get dropdown list Setyourprofile string SetyourprofileString = "Public,Private"; IEnumerable <SetYourProfile> InfoSetyourprofile = from name in SetyourprofileString.Split(',') select new SetYourProfile() { Setyourprofile = name, NameSetYourProfile = name }; List <SetYourProfile> listSetyourprofile = InfoSetyourprofile.ToList(); ViewBag.SetyourprofileList = listSetyourprofile; //Get dropdown list Profession string ProfessionString = "Professional,Private"; IEnumerable <ProfessionProfile> InfoProfession = from name in ProfessionString.Split(',') select new ProfessionProfile() { Profession = name, NameProfession = name }; List <ProfessionProfile> listProfession = InfoProfession.ToList(); ViewBag.ProfessionList = listProfession; var itemAdd = new SearchAddress() { City = null, Country = null, Provinsi = null }; var AddressResult = await reader.SearchAddress(itemAdd); ViewBag.AddressList = AddressResult; var itemSector = new SearchSector() { SectorName = null }; var SectorResult = await reader.SearchSector(itemSector); ViewBag.SectorList = SectorResult; //setting label kanan var FullNameRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.FullName == x.FullName)?.FullName; ViewBag.FullNameLabel = FullNameRightLabel; var ProfessionRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.Profession == x.Profession)?.Profession; ViewBag.ProfessionLabel = ProfessionRightLabel; var EmailRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.Email == x.Email)?.Email; ViewBag.EmailLabel = EmailRightLabel; var PhoneRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.Phone == x.Phone)?.Phone; ViewBag.PhoneLabel = PhoneRightLabel; var JobTitleRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.JobTitle == x.JobTitle)?.JobTitle; ViewBag.JobTitleLabel = JobTitleRightLabel; //formatRight tanggal kanan var DOBRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.DOB == x.DOB)?.DOB; var DOBRightTemp = DOBRightLabel.Substring(0, 10); //var time = DateTime.Now.ToString("hh:mm:ss"); string formatRight = "yyyy-MM-dd"; CultureInfo providerRight = CultureInfo.InvariantCulture; var dateRight = DateTime.ParseExact(DOBRightTemp, formatRight, providerRight); var dateFinalRight = Convert.ToDateTime(dateRight).ToString("dd MMMM yyyy"); ViewBag.DOBLabel = dateFinalRight; //await Task.Run(() => //{ // ViewBag.MemberList = reader.GetMemberAsync().Result; //}); return(await Task.FromResult(View(profile))); }
public async Task <ActionResult> UpdateProfile(string userName, string clientKey = null, string apiKey = null) { ViewBag.IsAlertResponse = false; ViewBag.ActivityResponsMessage = null; var identity = (ClaimsPrincipal)Thread.CurrentPrincipal; userName = identity.Claims.Where(c => c.Type == ClaimTypes.Name) .Select(c => c.Value).SingleOrDefault(); var fetchingProfileList = await reader.SearchProfileIndex(userName); if (userName != null) { //var resultBenefit = reader.GetBenefitItem(); Profile model = new Profile(); //side menu validasi var role = fetchingProfileList.Data.FirstOrDefault(x => x.RoleID == x.RoleID)?.RoleID; ViewBag.roleID = role; var loginUser = userName; ViewBag.UserLogin = loginUser; //Get dropdown list gender string genderString = "Laki-laki,Wanita"; IEnumerable <GenderProfile> Infogender = from name in genderString.Split(',') select new GenderProfile() { Gender = name, NameGender = name }; List <GenderProfile> listGender = Infogender.ToList(); ViewBag.GenderList = listGender; //Get dropdown list Experience string experienceString = "Fresh Graduate,1 Tahun,2 Tahun,3 Tahun,4 Tahun,5 Tahun"; IEnumerable <ExperienceProfile> Infoexperience = from name in experienceString.Split(',') select new ExperienceProfile() { Experience = name, NameExperience = name }; List <ExperienceProfile> listExp = Infoexperience.ToList(); ViewBag.ExpList = listExp; //Get dropdown list Qualification string QualificationString = "SMK/SMA,Diploma 1,Diploma 2,Diploma 3,Sarjana 1,Sarjana 2,Sarjana 3"; IEnumerable <QualificationProfile> InfoQualification = from name in QualificationString.Split(',') select new QualificationProfile() { Qualification = name, NameQualification = name }; List <QualificationProfile> listQualification = InfoQualification.ToList(); ViewBag.QualificationList = listQualification; //Get dropdown list Jabatan string JabatanString = "Staff,Manager,Supervisor"; IEnumerable <JabatanProfile> InfoJabatan = from name in JabatanString.Split(',') select new JabatanProfile() { Jabatan = name, NameJabatan = name }; List <JabatanProfile> listJabatan = InfoJabatan.ToList(); ViewBag.JabatanList = listJabatan; //Get dropdown list Type string TypeString = "Freelance,Kontrak,Paruh Waktu,Penuh Waktu"; IEnumerable <TypeProfile> InfoType = from name in TypeString.Split(',') select new TypeProfile() { Type = name, NameType = name }; List <TypeProfile> listType = InfoType.ToList(); ViewBag.TypeList = listType; //Get dropdown list Setyourprofile string SetyourprofileString = "Public,Private"; IEnumerable <SetYourProfile> InfoSetyourprofile = from name in SetyourprofileString.Split(',') select new SetYourProfile() { Setyourprofile = name, NameSetYourProfile = name }; List <SetYourProfile> listSetyourprofile = InfoSetyourprofile.ToList(); ViewBag.SetyourprofileList = listSetyourprofile; //Get dropdown list Profession string ProfessionString = "Professional,Private"; IEnumerable <ProfessionProfile> InfoProfession = from name in ProfessionString.Split(',') select new ProfessionProfile() { Profession = name, NameProfession = name }; List <ProfessionProfile> listProfession = InfoProfession.ToList(); ViewBag.ProfessionList = listProfession; var item = new SearchAddress() { City = null, Country = null, Provinsi = null }; var AddressResult = await reader.SearchAddress(item); ViewBag.AddressList = AddressResult; var itemSector = new SearchSector() { SectorName = null }; var SectorResult = await reader.SearchSector(itemSector); ViewBag.SectorList = SectorResult; //setting label kanan var FullNameRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.FullName == x.FullName)?.FullName; ViewBag.FullNameLabel = FullNameRightLabel; var ProfessionRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.Profession == x.Profession)?.Profession; ViewBag.ProfessionLabel = ProfessionRightLabel; var EmailRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.Email == x.Email)?.Email; ViewBag.EmailLabel = EmailRightLabel; var PhoneRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.Phone == x.Phone)?.Phone; ViewBag.PhoneLabel = PhoneRightLabel; var JobTitleRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.JobTitle == x.JobTitle)?.JobTitle; ViewBag.JobTitleLabel = JobTitleRightLabel; //formatRight tanggal kanan var DOBRightLabel = fetchingProfileList.Data.FirstOrDefault(x => x.DOB == x.DOB)?.DOB; var DOBRightTemp = DOBRightLabel.Substring(0, 10); //var time = DateTime.Now.ToString("hh:mm:ss"); string formatRight = "yyyy-MM-dd"; CultureInfo providerRight = CultureInfo.InvariantCulture; var dateRight = DateTime.ParseExact(DOBRightTemp, formatRight, providerRight); var dateFinalRight = Convert.ToDateTime(dateRight).ToString("dd MMMM yyyy"); ViewBag.DOBLabel = dateFinalRight; foreach (var itemValue in fetchingProfileList.Data) { var DOBTemp = itemValue.DOB.Substring(0, 10); //var time = DateTime.Now.ToString("hh:mm:ss"); string format = "yyyy-MM-dd"; CultureInfo provider = CultureInfo.InvariantCulture; var date = DateTime.ParseExact(DOBTemp, format, provider); var dateFinal = Convert.ToDateTime(date).ToString("MM/dd/yyyyThh:mm:ss.549Z").Substring(0, 10); if (dateFinal.Equals("01/01/0001")) { var dateval = DateTime.Now.ToString("MM/dd/yyyy"); dateFinal = dateval; } model = new Profile() { ProfileID = itemValue.ProfileID, Email = itemValue.Email, FullName = itemValue.FullName, RoleID = itemValue.RoleID, Username = itemValue.Username, Profession = itemValue.Profession, DOB = dateFinal, Gender = itemValue.Gender, Phone = itemValue.Phone, CoverImage = itemValue.CoverImage, Experience = itemValue.Experience, ProfileImage = itemValue.ProfileImage, Jabatan = itemValue.Jabatan, Qualification = itemValue.Qualification, Type = itemValue.Type, SalaryRange = itemValue.SalaryRange, Setyourprofile = itemValue.Setyourprofile, AboutSelf = itemValue.AboutSelf, JobTitle = itemValue.JobTitle, SectorID = itemValue.SectorID, AddID = itemValue.AddID, PostalCode = itemValue.PostalCode, FullAddress = itemValue.FullAddress, CompanyName = itemValue.CompanyName, IsActive = itemValue.IsActive, }; } return(View(model)); } else { return(RedirectToAction("signin", "Home")); } }
//// GET: api/Evac //public IEnumerable<string> Get() //{ // return new string[] { "value1", "value2" }; //} //// GET: api/Evac/5 //public string Get(int id) //{ // return "value"; //} // POST: api/Evac public List <FoundAddress> Post(SearchAddress sa) { return(FoundAddress.Find(sa)); }
public IHttpActionResult Post(SearchAddress sa) { return(Ok(FoundAddress.Find(sa))); }