public App() { InitializeComponent(); /* * The client signature will will dentify the * client device when diagnosing issues. * */ string clientSignature = JsonConvert.SerializeObject(( Model: DeviceInfo.Model, Manufacturer: DeviceInfo.Manufacturer, Name: DeviceInfo.Name, Platform: DeviceInfo.Platform, Idiom: DeviceInfo.Idiom, DeviceType: DeviceInfo.DeviceType, HardwareVersion: DeviceInfo.VersionString, SoftwareVersion: typeof(AppShell).GetTypeInfo() .Assembly.GetName().Version.ToString(), ApiVersion: ApiVersion )); _backend = new BackendService <Trader>(); _backend.Version = ApiVersion; _backend.DeviceSignature = clientSignature; _backend.Address = DevelopmentBackend; _backend.AutoTokenRenew = true; IndustryViewModel.Init(_backend); MainPage = new AppShell(); }
private async void Create_Clicked(object sender, EventArgs e) { Industry industry = new Industry(); industry.Industry_Name = industryName.Text; //using (SQLiteConnection conn = new SQLiteConnection(App.DatabaseLocation)) //{ // conn.CreateTable<Industry>(); // conn.Insert(industry); //IndustryViewModel.addItem(industry); // //IndustryViewModel //} Uri uri = new Uri(String.Format(Constants.AddIndustryURL, String.Empty)); using (HttpClient client = new HttpClient()) { var json = JsonConvert.SerializeObject(industry); var stringContent = new StringContent(json, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync(uri, stringContent); //var industries = JsonConvert.DeserializeObject<List<Industry>>(response); } IndustryViewModel.addItem(industry); await Navigation.PopAsync(); }
public async Task <List <IndustryViewModel> > FetchIndustries() { IList <industry> industries = await _businessLayer.GetAllIndustryAsync(); //Need to call GetAllIndustries from database List <IndustryViewModel> industryViewModel = new List <IndustryViewModel>(); if (industries != null && industries.Count > 0) { foreach (industry _industry in industries) { IndustryViewModel companyVM = new IndustryViewModel() { IndustryId = _industry.IndustryId, Name = _industry.Name, Description = _industry.Description, IsActive = _industry.IsActive }; industryViewModel.Add(companyVM); } } return(industryViewModel); }
public async Task <JsonResult> UpdateIndustry([Required] IndustryViewModel model) { if (!ModelState.IsValid) { return(Json(new InvalidParametersResultModel().AttachModelState(ModelState))); } return(await JsonAsync(_industryService.UpdateIndustryAsync(model))); }
public JwtauthPage() { _viewModel = IndustryViewModel.Current; _busyBundle = new ControlBundle( new List <VisualElement> { }); }
public ActionResult FreeTrail() { NewsDataStore Obj = new NewsDataStore(); DealsDataStore d = new DealsDataStore(); IndustryViewModel model = new IndustryViewModel(); List <SA_News> NewsList = Obj.GetNewsList(); model.NewsList = NewsList; List <SA_Deals> DealList = d.GetDealsList(); model.DealsList = DealList; return(View("FreeTrial", model)); }
public void it_should_map_the_industry_view_model_to_the_industry_entity() { var vm = new IndustryViewModel { Id = 1, Name = "Test Industry" }; var result = this.mapper.Map <Industry>(vm); Assert.AreEqual(vm.Id, result.Id); Assert.AreEqual(vm.Name, result.Name); }
public async Task <IActionResult> Search([FromBody] IndustryViewModel ivm) { try { return(Ok(await iRepo.GetIndustryByParams(ivm))); } catch (CustomException cex) { var responseObj = new EmaintenanceMessage(cex.Message, cex.Type, cex.IsException, cex.Exception?.ToString()); return(StatusCode(StatusCodes.Status500InternalServerError, responseObj)); } catch (Exception ex) { return(Ok(new EmaintenanceMessage(ex.Message))); } }
public ActionResult IndustryReport(int id) { NewsDataStore n = new NewsDataStore(); DealsDataStore d = new DealsDataStore(); IndustryViewModel model = new IndustryViewModel(); List <SA_Industry> IndustryList = Obj.GetIndustryList().Where(w => w.id == id).OrderBy(w => w.id).ToList();; model.Industry = IndustryList; List <SA_News> NewsList = n.GetNewsList(); model.NewsList = NewsList; List <SA_Deals> DealList = d.GetDealsList(); model.DealsList = DealList; return(View(model)); }
public async Task <IEnumerable <dynamic> > GetIndustryByParams(IndustryViewModel ivm) { string sql = "dbo.EAppListIndustry"; using (var conn = util.MasterCon()) { try { return(await(conn.QueryAsync <dynamic>(sql, new { ivm.LanguageId, ivm.SectorId, ivm.SegmentId, ivm.Status }, commandType: CommandType.StoredProcedure))); } catch (Exception ex) { throw new CustomException("Unable to Load Data, Please Contact Support!!!", "Error", true, ex); } } }
public ActionResult IndustryReports(int id) { NewsDataStore n = new NewsDataStore(); DealsDataStore d = new DealsDataStore(); IndustryViewModel model = new IndustryViewModel(); //List<SA_Industry> IndustryList = Obj.GetIndustryList(); List <SA_Industry> IndustryList = Obj.GetCustIndustryList(id); model.Industry = IndustryList; List <SA_News> NewsList = n.GetNewsList(); model.NewsList = NewsList; List <SA_Deals> DealList = d.GetDealsList(); model.DealsList = DealList; return(View(model)); }
/// <summary> /// Update industry /// </summary> /// <param name="model"></param> /// <returns></returns> public virtual async Task <ResultModel> UpdateIndustryAsync(IndustryViewModel model) { if (model == null) { return(new InvalidParametersResultModel()); } var industry = await _context.Industries.FirstOrDefaultAsync(x => x.Id == model.Id); if (industry == null) { return(new NotFoundResultModel()); } industry.Name = model.Name; _context.Industries.Update(industry); return(await _context.PushAsync()); }
public async Task <IActionResult> Create([FromBody] IndustryViewModel ivm) { try { CurrentUser cUser = new CurrentUser(HttpContext, _configuration); ivm.UserId = cUser.UserId; ivm.IndustryId = 0; ivm.Active = "Y"; return(Ok(await iRepo.SaveOrUpdate(ivm))); } catch (CustomException cex) { var returnObj = new EmaintenanceMessage(cex.Message, cex.Type, cex.IsException, cex.Exception?.ToString()); return(StatusCode(StatusCodes.Status500InternalServerError, returnObj)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, new EmaintenanceMessage(ex.Message))); } }
/// <summary> /// Add new industry /// </summary> /// <param name="model"></param> /// <returns></returns> public virtual async Task <ResultModel <Guid> > AddNewIndustryAsync(IndustryViewModel model) { if (model == null) { return(new InvalidParametersResultModel <Guid>()); } var newIndustry = new Industry { Name = model.Name }; await _context.Industries.AddAsync(newIndustry); var result = await _context.PushAsync(); return(new ResultModel <Guid> { IsSuccess = result.IsSuccess, Errors = result.Errors, Result = newIndustry.Id }); }
public ActionResult Reportsection() { string cate = Request.Form["categoryname"] != null ? Request.Form["categoryname"].ToString() : ""; string country = Request.Form["countryname"] != null ? Request.Form["countryname"].ToString() : ""; ViewBag.Cat = cate; ViewBag.Cou = country; CategoryDataStore d = new CategoryDataStore(); IndustryViewModel model = new IndustryViewModel(); List <SA_Industry> IndustryList = Obj.GetIndustryList().Where(x => (cate == "" || cate.Contains(x.CategoryID.ToString() + ",")) && (country == "" || country.Contains(x.CountryID.ToString() + ","))).OrderBy(w => w.id).OrderByDescending(w => w.id).ToList(); model.Industry = IndustryList; List <SelectListItem> lstCategory = d.CategoryList(); model.lstCategory = lstCategory; List <SelectListItem> lstCountry = d.CountryList(); model.lstCountry = lstCountry; return(View("report-section", model)); }
public async Task <IEnumerable <dynamic> > SaveOrUpdate([FromBody] IndustryViewModel svm) { string sql = "dbo.EAppSaveIndustry"; using (var conn = util.MasterCon()) { try { return(await(conn.QueryAsync <dynamic>(sql, new { svm.IndustryId, svm.SegmentId, svm.LanguageId, svm.IndustryCode, svm.IndustryName, svm.Descriptions, svm.Active, svm.DownTimeCostPerHour, svm.UserId }, commandType: CommandType.StoredProcedure))); } catch (SqlException sqlException) { if (sqlException.Number == 2601 || sqlException.Number == 2627) { throw new CustomException("Duplicate", "Industry Code already Exists.", "Error", true, sqlException); } else { throw new CustomException("Due to some Technical Reason, Unable to Save or Update", "Error", true, sqlException); } } catch (Exception ex) { throw new CustomException("Unable to Save Or Update, Please Contact Support!!!", "Error", true, ex); } } }
public IActionResult PublishJob() { var locationsFromDTO = this.locationsService.GetAllLocations(); List <SelectListItem> locations = new List <SelectListItem>(); foreach (var location in locationsFromDTO) { SelectListItem l = new SelectListItem() { Value = location.Id.ToString(), Text = location.Name }; locations.Add(l); } var employmentTypesFromDTO = this.jobsService.GetEmploymentTypes(); List <SelectListItem> employmentTypes = new List <SelectListItem>(); foreach (var et in employmentTypesFromDTO) { SelectListItem e = new SelectListItem() { Value = et.Id.ToString(), Text = et.Name }; employmentTypes.Add(e); } var seniorityLevelsFromDTO = this.jobsService.GetSeniorityLevels(); List <SelectListItem> seniorityLevels = new List <SelectListItem>(); foreach (var sl in seniorityLevelsFromDTO) { SelectListItem s = new SelectListItem() { Value = sl.Id.ToString(), Text = sl.Name }; seniorityLevels.Add(s); } var industriesFromDTO = this.industriesService.GetAllIndustries(); List <IndustryViewModel> industries = new List <IndustryViewModel>(); foreach (var industry in industriesFromDTO) { IndustryViewModel i = new IndustryViewModel(); i.Id = industry.Id; i.Name = industry.Name; foreach (var job in industry.Jobs) { i.Jobs.Add(new EditJobViewModel { Id = job.Id, Position = job.Position, Location = job.Location.Name, Description = job.Description, Salary = job.Salary, SubIndustry = job.SubIndustry.Name, EmploymentType = job.EmploymentType.Name, SeniorityLevel = job.SeniorityLevel.Name }); } foreach (var subIndustry in industry.SubIndustries) { i.SubIndustries.Add(new SubIndustryViewModel { Id = subIndustry.Id, Name = subIndustry.Name }); } industries.Add(i); } var viewModel = new JobFullInfoViewModel { Job = new EditJobViewModel(), Industries = industries, Locations = locations, EmploymentTypes = employmentTypes, SeniorityLevels = seniorityLevels }; return(this.View(viewModel)); }
// GET: AdminController/Create //public ActionResult Create() //{ // return View(); //} // POST: AdminController/Create //[HttpPost] //[ValidateAntiForgeryToken] //public ActionResult Create(IFormCollection collection) //{ // try // { // return RedirectToAction(nameof(Index)); // } // catch // { // return View(); // } //} // GET: AdminController/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(this.NotFound()); } var locationsFromDTO = this.locationsService.GetAllLocations(); List <SelectListItem> locations = new List <SelectListItem>(); foreach (var location in locationsFromDTO) { SelectListItem l = new SelectListItem() { Value = location.Id.ToString(), Text = location.Name }; locations.Add(l); } var employmentTypesFromDTO = this.jobsService.GetEmploymentTypes(); List <SelectListItem> employmentTypes = new List <SelectListItem>(); foreach (var et in employmentTypesFromDTO) { SelectListItem e = new SelectListItem() { Value = et.Id.ToString(), Text = et.Name }; employmentTypes.Add(e); } var seniorityLevelsFromDTO = this.jobsService.GetSeniorityLevels(); List <SelectListItem> seniorityLevels = new List <SelectListItem>(); foreach (var sl in seniorityLevelsFromDTO) { SelectListItem s = new SelectListItem() { Value = sl.Id.ToString(), Text = sl.Name }; seniorityLevels.Add(s); } var industriesFromDTO = this.industriesService.GetAllIndustries(); List <IndustryViewModel> industries = new List <IndustryViewModel>(); foreach (var industry in industriesFromDTO) { IndustryViewModel i = new IndustryViewModel(); i.Id = industry.Id; i.Name = industry.Name; foreach (var j in industry.Jobs) { i.Jobs.Add(new EditJobViewModel { Id = j.Id, Position = j.Position, Location = j.Location.Name, Description = j.Description, Salary = j.Salary, SubIndustry = j.SubIndustry.Name, EmploymentType = j.EmploymentType.Name, SeniorityLevel = j.SeniorityLevel.Name }); } foreach (var subIndustry in industry.SubIndustries) { i.SubIndustries.Add(new SubIndustryViewModel { Id = subIndustry.Id, Name = subIndustry.Name }); } industries.Add(i); } var job = this.jobsService.GetJobInfo((Guid)id, null); if (job == null) { return(this.NotFound()); } var jobViewModel = new EditJobViewModel { Id = job.Id, Position = job.Position, Employer = job.Employer, Location = job.Location, Description = job.Description, Salary = job.Salary, Keywords = String.Join(',', job.Keywords), SubIndustry = job.SubIndustry, EmploymentType = job.EmploymentType, SeniorityLevel = job.SeniorityLevel }; var viewModel = new JobFullInfoViewModel { Job = jobViewModel, Industries = industries, Locations = locations, EmploymentTypes = employmentTypes, SeniorityLevels = seniorityLevels }; return(this.View(viewModel)); }