protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); SetTheme(AppSettings.SetTabDarkTheme ? Resource.Style.MyTheme_Dark_Base : Resource.Style.MyTheme_Base); Methods.App.FullScreenApp(this); // Create your application here SetContentView(Resource.Layout.RecyclerDefaultLayout); var dataObject = Intent?.GetStringExtra("JobsObject"); if (!string.IsNullOrEmpty(dataObject)) { DataInfoObject = JsonConvert.DeserializeObject <JobInfoObject>(dataObject); } //Get Value And Set Toolbar InitComponent(); InitToolbar(); SetRecyclerViewAdapters(); StartApiService(); } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); SetTheme(AppSettings.SetTabDarkTheme ? Resource.Style.MyTheme_Dark_Base : Resource.Style.MyTheme_Base); Methods.App.FullScreenApp(this); // Create your application here SetContentView(Resource.Layout.ApplyJoblayout); var dataObject = Intent.GetStringExtra("JobsObject"); if (!string.IsNullOrEmpty(dataObject)) { DataInfoObject = JsonConvert.DeserializeObject <JobInfoObject>(dataObject); } //Get Value And Set Toolbar InitComponent(); InitToolbar(); LoadMyDate(); } catch (Exception e) { Console.WriteLine(e); } }
private void DestroyBasic() { try { TxtSave = null !; IconTitle = null !; TxtTitle = null !; IconLocation = null !; TxtLocation = null !; IconSalary = null !; TxtMinimum = null !; TxtMaximum = null !; IconSalaryDate = null !; TxtSalaryDate = null !; IconJobType = null !; TxtJobType = null !; IconCategory = null !; TxtCategory = null !; IconDescription = null !; TxtDescription = null !; TypeDialog = null !; CategoryId = null !; JobTypeId = null !; SalaryDateId = null !; DataInfoObject = null !; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void DestroyBasic() { try { TxtSave = null; IconTitle = null; TxtTitle = null; IconLocation = null; TxtLocation = null; IconSalary = null; TxtMinimum = null; TxtMaximum = null; IconSalaryDate = null; TxtSalaryDate = null; IconJobType = null; TxtJobType = null; IconCategory = null; TxtCategory = null; IconDescription = null; TxtDescription = null; TypeDialog = null; CategoryId = null; JobTypeId = null; SalaryDateId = null; DataInfoObject = null; } catch (Exception e) { Console.WriteLine(e); } }
protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); SetTheme(AppSettings.SetTabDarkTheme ? Resource.Style.MyTheme_Dark_Base : Resource.Style.MyTheme_Base); Methods.App.FullScreenApp(this); // Create your application here SetContentView(Resource.Layout.EditJobsLayout); var dataObject = Intent?.GetStringExtra("JobsObject"); DataInfoObject = string.IsNullOrEmpty(dataObject) switch { false => JsonConvert.DeserializeObject <JobInfoObject>(dataObject), _ => DataInfoObject }; //Get Value And Set Toolbar InitComponent(); InitToolbar(); BindJobPost(); } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void BindJobPost() { try { if (DataInfoObject != null) { DataInfoObject = WoWonderTools.ListFilterJobs(DataInfoObject); TxtTitle.Text = Methods.FunString.DecodeString(DataInfoObject.Title); TxtLocation.Text = DataInfoObject.Location; //Set Description TxtDescription.Text = Methods.FunString.DecodeString(DataInfoObject.Description); TxtMinimum.Text = DataInfoObject.Minimum; TxtMaximum.Text = DataInfoObject.Maximum; //Set Salary Date SalaryDateId = DataInfoObject.SalaryDate; TxtSalaryDate.Text = DataInfoObject.SalaryDate switch { "per_hour" => GetString(Resource.String.Lbl_per_hour), "per_day" => GetString(Resource.String.Lbl_per_day), "per_week" => GetString(Resource.String.Lbl_per_week), "per_month" => GetString(Resource.String.Lbl_per_month), "per_year" => GetString(Resource.String.Lbl_per_year), _ => TxtSalaryDate.Text }; //Set job type JobTypeId = DataInfoObject.JobType; TxtJobType.Text = DataInfoObject.JobType switch { "full_time" => GetString(Resource.String.Lbl_full_time), "part_time" => GetString(Resource.String.Lbl_part_time), "internship" => GetString(Resource.String.Lbl_internship), "volunteer" => GetString(Resource.String.Lbl_volunteer), "contract" => GetString(Resource.String.Lbl_contract), _ => TxtJobType.Text }; CategoryId = DataInfoObject.Category; TxtCategory.Text = CategoriesController.ListCategoriesJob.FirstOrDefault(categories => categories.CategoriesId == DataInfoObject.Category)?.CategoriesName; } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void DestroyBasic() { try { TxtSave = null; IconName = null; TxtName = null; IconLocation = null; TxtLocation = null; IconPhone = null; TxtPhone = null; IconEmail = null; TxtEmail = null; IconPosition = null; TxtPosition = null; IconWork = null; TxtWork = null; IconDescription = null; TxtDescription = null; IconDate = null; TxtFromDate = null; TxtToDate = null; ChkCurrentlyWork = null; DataInfoObject = null; QuestionOneLayout = null; DialogType = null; TxtQuestion = null; CurrentlyWork = null; EdtQuestion = null; RdoYes = null; RdoNo = null; InflatedQuestionOne = null; InflatedQuestionTwo = null; InflatedQuestionThree = null; QuestionTwoLayout = null; QuestionThreeLayout = null; QuestionOneAnswer = null; QuestionTwoAnswer = null; QuestionThreeAnswer = null; } catch (Exception e) { Console.WriteLine(e); } }
private void DestroyBasic() { try { TxtSave = null !; IconName = null !; TxtName = null !; IconLocation = null !; TxtLocation = null !; IconPhone = null !; TxtPhone = null !; IconEmail = null !; TxtEmail = null !; IconPosition = null !; TxtPosition = null !; IconWork = null !; TxtWork = null !; IconDescription = null !; TxtDescription = null !; IconDate = null !; TxtFromDate = null !; TxtToDate = null !; ChkCurrentlyWork = null !; DataInfoObject = null !; QuestionOneLayout = null !; DialogType = null !; TxtQuestion = null !; CurrentlyWork = null !; EdtQuestion = null !; RdoYes = null !; RdoNo = null !; InflatedQuestionOne = null !; InflatedQuestionTwo = null !; InflatedQuestionThree = null !; QuestionTwoLayout = null !; QuestionThreeLayout = null !; QuestionOneAnswer = null !; QuestionTwoAnswer = null !; QuestionThreeAnswer = null !; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public static JobInfoObject ListFilterJobs(JobInfoObject jobInfoObject) { try { if (!jobInfoObject.Image.Contains(Client.WebsiteUrl)) { jobInfoObject.Image = Client.WebsiteUrl + "/" + jobInfoObject.Image; } jobInfoObject.IsOwner = jobInfoObject.UserId == UserDetails.UserId; return(jobInfoObject); } catch (Exception e) { Console.WriteLine(e); return(jobInfoObject); } }
public static JobInfoObject ListFilterJobs(JobInfoObject jobInfoObject) { try { if (!jobInfoObject.Image.Contains(Client.WebsiteUrl)) { jobInfoObject.Image = Client.WebsiteUrl + "/" + jobInfoObject.Image; } jobInfoObject.IsOwner = jobInfoObject.UserId == UserDetails.UserId; return(jobInfoObject); } catch (Exception e) { Methods.DisplayReportResultTrack(e); return(jobInfoObject); } }
private void DestroyBasic() { try { MAdView?.Destroy(); MAdapter = null !; SwipeRefreshLayout = null !; MRecycler = null !; EmptyStateLayout = null !; Inflated = null !; MainScrollEvent = null !; DataInfoObject = null !; MAdView = null !; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void DestroyBasic() { try { MAdView?.Destroy(); MAdapter = null; SwipeRefreshLayout = null; MRecycler = null; EmptyStateLayout = null; Inflated = null; MainScrollEvent = null; DataInfoObject = null; MAdView = null; } catch (Exception e) { Console.WriteLine(e); } }
// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { try { if (viewHolder is JobsAdapterViewHolder holder) { var item = JobList[position]; if (item != null) { if (item.Image.Contains("http")) { var image = item.Image.Replace(Client.WebsiteUrl + "/", ""); if (!image.Contains("http")) { item.Image = Client.WebsiteUrl + "/" + image; } else { item.Image = image; } GlideImageLoader.LoadImage(ActivityContext, item.Image, holder.Image, ImageStyle.FitCenter, ImagePlaceholders.Drawable); } else { File file2 = new File(item.Image); var photoUri = FileProvider.GetUriForFile(ActivityContext, ActivityContext.PackageName + ".fileprovider", file2); Glide.With(ActivityContext).Load(photoUri).Apply(new RequestOptions()).Into(holder.Image); } holder.Title.Text = Methods.FunString.DecodeString(item.Title); var(currency, currencyIcon) = WoWonderTools.GetCurrency(item.Currency); var categoryName = CategoriesController.ListCategoriesJob.FirstOrDefault(categories => categories.CategoriesId == item.Category)?.CategoriesName; Console.WriteLine(currency); if (string.IsNullOrEmpty(categoryName)) { categoryName = Application.Context.GetText(Resource.String.Lbl_Unknown); } holder.Salary.Text = currencyIcon + " " + item.Minimum + " - " + currencyIcon + " " + item.Maximum + " . " + categoryName; holder.Description.Text = Methods.FunString.SubStringCutOf(Methods.FunString.DecodeString(item.Description), 100); if (item.IsOwner) { holder.IconMore.Visibility = ViewStates.Visible; holder.Button.Text = ActivityContext.GetString(Resource.String.Lbl_show_applies) + " (" + item.ApplyCount + ")"; holder.Button.Tag = "ShowApply"; } else { holder.IconMore.Visibility = ViewStates.Gone; } //Set Button if its applied if (item.Apply == "true") { holder.Button.Text = ActivityContext.GetString(Resource.String.Lbl_already_applied); holder.Button.Enabled = false; } if (!holder.Button.HasOnClickListeners) { holder.Button.Click += (sender, args) => { try { switch (holder.Button.Tag.ToString()) { // Open Apply Job Activity case "ShowApply": { if (item.ApplyCount == "0") { Toast.MakeText(ActivityContext, ActivityContext.GetString(Resource.String.Lbl_ThereAreNoRequests), ToastLength.Short).Show(); return; } var intent = new Intent(ActivityContext, typeof(ShowApplyJobActivity)); intent.PutExtra("JobsObject", JsonConvert.SerializeObject(item)); ActivityContext.StartActivity(intent); break; } case "Apply": { var intent = new Intent(ActivityContext, typeof(ApplyJobActivity)); intent.PutExtra("JobsObject", JsonConvert.SerializeObject(item)); ActivityContext.StartActivity(intent); break; } } } catch (Exception e) { Console.WriteLine(e); } }; holder.IconMore.Click += (sender, args) => { try { DialogType = "More"; DataInfoObject = item; var arrayAdapter = new List <string>(); var dialogList = new MaterialDialog.Builder(ActivityContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light); arrayAdapter.Add(ActivityContext.GetText(Resource.String.Lbl_Edit)); arrayAdapter.Add(ActivityContext.GetText(Resource.String.Lbl_Delete)); dialogList.Title(ActivityContext.GetText(Resource.String.Lbl_More)); dialogList.Items(arrayAdapter); dialogList.NegativeText(ActivityContext.GetText(Resource.String.Lbl_Close)).OnNegative(this); dialogList.AlwaysCallSingleChoiceCallback(); dialogList.ItemsCallback(this).Build().Show(); } catch (Exception e) { Console.WriteLine(e); } }; } } } } catch (Exception exception) { Console.WriteLine(exception); } }
private void BindJobPost() { try { if (DataInfoObject != null) { DataInfoObject = WoWonderTools.ListFilterJobs(DataInfoObject); GlideImageLoader.LoadImage(this, DataInfoObject.Page.Avatar, JobAvatar, ImageStyle.RoundedCrop, ImagePlaceholders.Drawable); var image = DataInfoObject.Image.Replace(Client.WebsiteUrl + "/", ""); if (!image.Contains("http")) { DataInfoObject.Image = Client.WebsiteUrl + "/" + image; } else { DataInfoObject.Image = image; } GlideImageLoader.LoadImage(this, DataInfoObject.Image, JobCoverImage, ImageStyle.FitCenter, ImagePlaceholders.Drawable); if (DataInfoObject.IsOwner != null && DataInfoObject.IsOwner.Value) { TxtMore.Visibility = ViewStates.Visible; JobButton.Text = GetString(Resource.String.Lbl_show_applies) + " (" + DataInfoObject.ApplyCount + ")"; JobButton.Tag = "ShowApply"; } //Set Button if its applied if (DataInfoObject.Apply == "true") { JobButton.Text = GetString(Resource.String.Lbl_already_applied); JobButton.Enabled = false; } JobTitle.Text = Methods.FunString.DecodeString(DataInfoObject.Title); if (DataInfoObject.Page != null) { PageName.Text = "@" + Methods.FunString.DecodeString(DataInfoObject.Page.PageName.Replace("@", "")); if (DataInfoObject.Page.IsPageOnwer != null && DataInfoObject.Page.IsPageOnwer.Value) { JobButton.Text = GetString(Resource.String.Lbl_show_applies) + " (" + DataInfoObject.ApplyCount + ")"; } } //Set Description var description = Methods.FunString.DecodeString(DataInfoObject.Description); Description.Text = description; ReadMoreOption.AddReadMoreTo(Description, new String(description)); //Set Salary Date string salaryDate = DataInfoObject.SalaryDate switch { "per_hour" => GetString(Resource.String.Lbl_per_hour), "per_day" => GetString(Resource.String.Lbl_per_day), "per_week" => GetString(Resource.String.Lbl_per_week), "per_month" => GetString(Resource.String.Lbl_per_month), "per_year" => GetString(Resource.String.Lbl_per_year), _ => GetString(Resource.String.Lbl_Unknown) }; MinimumNumber.Text = DataInfoObject.Minimum + " " + salaryDate; MaximumNumber.Text = DataInfoObject.Maximum + " " + salaryDate; //Set job Time var jobInfo = IonIconsFonts.Pin + " " + DataInfoObject.Location + " " + " "; jobInfo += IonIconsFonts.Time + " " + Methods.Time.TimeAgo(Convert.ToInt32(DataInfoObject.Time), false) + " " + " "; //Set job type if (DataInfoObject.JobType == "full_time") { jobInfo += IonIconsFonts.IosBriefcase + " " + GetString(Resource.String.Lbl_full_time); } else if (DataInfoObject.JobType == "part_time") { jobInfo += IonIconsFonts.IosBriefcase + " " + GetString(Resource.String.Lbl_part_time); } else if (DataInfoObject.JobType == "internship") { jobInfo += IonIconsFonts.IosBriefcase + " " + GetString(Resource.String.Lbl_internship); } else if (DataInfoObject.JobType == "volunteer") { jobInfo += IonIconsFonts.IosBriefcase + " " + GetString(Resource.String.Lbl_volunteer); } else if (DataInfoObject.JobType == "contract") { jobInfo += IonIconsFonts.IosBriefcase + " " + GetString(Resource.String.Lbl_contract); } else { jobInfo += IonIconsFonts.IosBriefcase + " " + GetString(Resource.String.Lbl_Unknown); } var categoryName = CategoriesController.ListCategoriesJob.FirstOrDefault(categories => categories.CategoriesId == DataInfoObject.Category)?.CategoriesName; jobInfo += " " + " " + IonIconsFonts.Pricetag + " " + categoryName; var woTextDecorator = new WoTextDecorator { DecoratedContent = new SpannableString(jobInfo), Content = jobInfo }; woTextDecorator.SetTextColor(IonIconsFonts.Pin, "#ff5722"); woTextDecorator.SetTextColor(IonIconsFonts.Time, "#4caf50"); woTextDecorator.SetTextColor(IonIconsFonts.IosBriefcase, "#2196f3"); woTextDecorator.SetTextColor(IonIconsFonts.Pricetag, "#795548"); woTextDecorator.Build(JobInfo, woTextDecorator.DecoratedContent); } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private async void TxtSaveOnClick(object sender, EventArgs e) { try { if (Methods.CheckConnectivity()) { if (string.IsNullOrEmpty(TxtTitle.Text) || string.IsNullOrEmpty(TxtLocation.Text) || string.IsNullOrEmpty(TxtMinimum.Text) || string.IsNullOrEmpty(TxtMaximum.Text) || string.IsNullOrEmpty(TxtSalaryDate.Text) || string.IsNullOrEmpty(TxtJobType.Text) || string.IsNullOrEmpty(TxtDescription.Text) || string.IsNullOrEmpty(TxtCategory.Text)) { Toast.MakeText(this, GetText(Resource.String.Lbl_Please_enter_your_data), ToastLength.Short)?.Show(); return; } //Show a progress AndHUD.Shared.Show(this, GetText(Resource.String.Lbl_Loading)); var(apiStatus, respond) = await RequestsAsync.Jobs.EditJob(DataInfoObject.Id, TxtTitle.Text, TxtDescription.Text, TxtLocation.Text, TxtMinimum.Text, TxtMaximum.Text, SalaryDateId, JobTypeId, CategoryId); if (apiStatus == 200) { if (respond is MessageJobObject result) { Console.WriteLine(result.MessageData); Toast.MakeText(this, GetString(Resource.String.Lbl_jobSuccessfullyEdited), ToastLength.Short)?.Show(); AndHUD.Shared.Dismiss(this); JobInfoObject newInfoObject = new JobInfoObject { Title = TxtTitle.Text, Location = TxtLocation.Text, Minimum = TxtMinimum.Text, Maximum = TxtMaximum.Text, SalaryDate = TxtSalaryDate.Text, JobType = TxtJobType.Text, Description = TxtDescription.Text, Category = CategoryId, }; JobInfoObject data = JobsActivity.GetInstance()?.MAdapter?.JobList?.FirstOrDefault(a => a.Id == DataInfoObject.Id); if (data != null) { data.Title = TxtTitle.Text; data.Location = TxtLocation.Text; data.Minimum = TxtMinimum.Text; data.Maximum = TxtMaximum.Text; data.SalaryDate = TxtSalaryDate.Text; data.JobType = TxtJobType.Text; data.Description = TxtDescription.Text; data.Category = CategoryId; JobsActivity.GetInstance().MAdapter.NotifyItemChanged(JobsActivity.GetInstance().MAdapter.JobList.IndexOf(data)); } Intent intent = new Intent(); intent.PutExtra("JobsItem", JsonConvert.SerializeObject(newInfoObject)); SetResult(Result.Ok, intent); Finish(); } } else { Methods.DisplayAndHudErrorResult(this, respond); } } else { Toast.MakeText(this, GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); } } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); AndHUD.Shared.Dismiss(this); } }
private void BindJobPost() { try { if (DataInfoObject != null) { DataInfoObject = WoWonderTools.ListFilterJobs(DataInfoObject); TxtTitle.Text = Methods.FunString.DecodeString(DataInfoObject.Title); TxtLocation.Text = DataInfoObject.Location; //Set Description TxtDescription.Text = Methods.FunString.DecodeString(DataInfoObject.Description); TxtMinimum.Text = DataInfoObject.Minimum; TxtMaximum.Text = DataInfoObject.Maximum; //Set Salary Date SalaryDateId = DataInfoObject.SalaryDate; switch (DataInfoObject.SalaryDate) { case "per_hour": TxtSalaryDate.Text = GetString(Resource.String.Lbl_per_hour); break; case "per_day": TxtSalaryDate.Text = GetString(Resource.String.Lbl_per_day); break; case "per_week": TxtSalaryDate.Text = GetString(Resource.String.Lbl_per_week); break; case "per_month": TxtSalaryDate.Text = GetString(Resource.String.Lbl_per_month); break; case "per_year": TxtSalaryDate.Text = GetString(Resource.String.Lbl_per_year); break; } //Set job type JobTypeId = DataInfoObject.JobType; switch (DataInfoObject.JobType) { case "full_time": TxtJobType.Text = GetString(Resource.String.Lbl_full_time); break; case "part_time": TxtJobType.Text = GetString(Resource.String.Lbl_part_time); break; case "internship": TxtJobType.Text = GetString(Resource.String.Lbl_internship); break; case "volunteer": TxtJobType.Text = GetString(Resource.String.Lbl_volunteer); break; case "contract": TxtJobType.Text = GetString(Resource.String.Lbl_contract); break; } CategoryId = DataInfoObject.Category; TxtCategory.Text = CategoriesController.ListCategoriesJob.FirstOrDefault(categories => categories.CategoriesId == DataInfoObject.Category)?.CategoriesName; } } catch (Exception e) { Console.WriteLine(e); } }