Exemple #1
0
        async void AcceptJob(object sender, EventArgs e)
        {
            MenuItem   item      = (MenuItem)sender;
            Submission applicant = item.CommandParameter as Submission;

            if (applicant.Status.Equals("Ent Approved") || applicant.Status.Equals("User Approved"))
            {
                await DisplayAlert("Alert Message", applicant.Username + " already accpted.", "Cancel");
            }
            else if (job.Status.Equals("End") || applicant.Status.Equals("JS Completed"))
            {
                await DisplayAlert("Alert Message", "This job has already ended/completed. Accept applicant is not allow in this stage anymore.", "Cancel");
            }
            else if (await this.DisplayAlert("Accept Applicant?", "Are you sure you want to accept applicant, " + applicant.Username + " ?", "Yes", "Cancel") == true)
            {
                this.IsBusy = true;
                try
                {
                    applicant.Status = "Ent Approved";
                    var accept = await entmanager.UpdateSubmission(applicant);

                    if (accept != null)
                    {
                        await DisplayAlert("Accepted Applicant", applicant.Username + " Accept Successful.", "Cancel");
                    }
                    else
                    {
                        await DisplayAlert("Failed", applicant.Username + " fail to accept.", "Cancel");
                    }
                }
                finally
                {
                    this.IsBusy = false;
                }
            }
        }
Exemple #2
0
        async void OnSave(object sender, EventArgs e)
        {
            int      id      = 0;
            string   comment = commentTxt.Text.TrimEnd();
            double   rate    = Math.Round(slider.Value, 2);
            DateTime today   = DateTime.Today;

            //Enterprise Feedback to Applicant
            if (enterprise != null)
            {
                JSFeedback jsfeedback     = new JSFeedback(id, enterprise.CompanyName, enterprise.Username, jobseeker.Name, jobseeker.Username, submission.Id, today, comment, rate);
                var        savejsfeedback = await entmanager.SaveFeedback(jsfeedback);

                if (savejsfeedback != null)
                {
                    submission.Status = "Ent Completed";
                    var updatesubmission = await entmanager.UpdateSubmission(submission);

                    if (updatesubmission != null)
                    {
                        await DisplayAlert("Submitted Successful", "Feedback submitted successfully.", "Cancel");

                        await Navigation.PopModalAsync();
                    }
                    else
                    {
                        await DisplayAlert("Error Message", "Something wents wrong in updating status.", "Cancel");
                    }
                }
                else
                {
                    await DisplayAlert("Sumission Failed", "Feedback fail to submit.", "Cancel");

                    await Navigation.PopModalAsync();
                }
            }
            else
            {
                var ent = await jsmanager.GetEnterprise(job.Entusername);

                EntFeedback entfeedback = new EntFeedback(id, ent.CompanyName, job.Entusername, jobseeker.Name, jobseeker.Username, submission.Id, today, comment, rate);
                var         convert     = JsonConvert.SerializeObject(entfeedback);
                await DisplayAlert("Submitted Successful", convert, "Cancel");

                var savefeedback = await jsmanager.SaveEntFeedback(entfeedback);

                if (savefeedback != null)
                {
                    submission.Status = "User Completed";
                    var updatesubmission = await jsmanager.UpdateSubmission(submission);

                    if (updatesubmission != null)
                    {
                        await DisplayAlert("Submitted Successful", "Feedback submitted successfully.", "Cancel");

                        await Navigation.PopModalAsync();
                    }
                    else
                    {
                        await DisplayAlert("Error Message", "Something wents wrong in updating status.", "Cancel");
                    }
                }
                else
                {
                    await DisplayAlert("Sumission Failed", "Feedback fail to submit.", "Cancel");

                    await Navigation.PopModalAsync();
                }
            }
        }