Пример #1
0
        public StackLayout CreateEditLineItem()
        {
            StackLayout slUpcomingLineItemLayout = new StackLayout();

            try
            {
                Label lblLineItemTitle = new Label {
                    HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, WidthRequest = 80
                };
                lblLineItemTitle.Text = model.LineItemDescription;
                rating = new CustomEntryForGeneralPurpose {
                    Placeholder = "Rating", HorizontalOptions = LayoutOptions.FillAndExpand, Keyboard = Keyboard.Numeric
                };
                rating.TextChanged += Rating_TextChanged;
                //rating.Text = "0";
                remark = new CustomEntryForGeneralPurpose {
                    Placeholder = "Remark", HorizontalOptions = LayoutOptions.FillAndExpand
                };

                remark.TextChanged += Remark_TextChanged;
                //remark.Text = "";
                StackLayout slLineItemTitle = new StackLayout
                {
                    Children = { lblLineItemTitle },
                    Padding  = new Thickness(0, 8, 0, 0)
                };
                slUpcomingLineItemLayout = new StackLayout
                {
                    Children        = { slLineItemTitle, rating, remark },
                    Orientation     = StackOrientation.Horizontal,
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                    Padding         = new Thickness(0, 0, 0, 0)
                };
                remark.IsEnabled = false;
                //Ratings ratingDetails = new Ratings()
                //{
                //    RatingId = model.Id,
                //    LineItemId = model.Id,
                //    Rating1 = int.Parse(rating.Text),
                //    Remarks = remark.Text
                //};
                //ACTContext.ratingDetailsListContext.Add(ratingDetails);
            }
            catch (Exception ex)
            { }
            return(slUpcomingLineItemLayout);
        }
Пример #2
0
        public void EducationDetailsLayout(List<College> college, List<UniversityModel> university, List<Qualification> qualifications, List<Degree> degrees, List<Education> educationList, List<Streams> streamList)
        {
            if (ACTContext.isLogin == true)
            {
                #region add education detail button
                Button btnAddNewWorkExp = new Button { Text = "Add education detail", HorizontalOptions = LayoutOptions.EndAndExpand, BackgroundColor = Color.FromHex("4690FB"), TextColor = Color.White, BorderRadius = 10, HeightRequest = 35, FontSize = 10, FontAttributes = FontAttributes.Bold };
                StackLayout sBtnAddNewWorkExp = new StackLayout
                {
                    Children = { btnAddNewWorkExp },
                    Orientation = StackOrientation.Horizontal,
                    Padding = new Thickness(2, 5, 2, 5)
                };
                #endregion

                #region university, college, pkrQualification, pkrDegree pickers
                Label lblEducationDetailsInfo = new Label { Text = "Education Details Information", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex("5e247f"), FontSize = 18, FontAttributes = FontAttributes.Bold, HeightRequest = 30 };
                StackLayout sEducationDetailInfo = new StackLayout
                {
                    Children = { lblEducationDetailsInfo },
                    Orientation = StackOrientation.Horizontal,
                    Padding = new Thickness(0, 50, 0, 10)
                };
                Seperator sListViewHeader = new Seperator();
                #region university name
                Label lblUniversityPickerTitle = new Label { Text = "University Name", TextColor = Color.Gray };
                pkrUniversityName = new Picker { IsVisible = false };
                pkrUniversityName.Title = "University Name";
                foreach (UniversityModel item in university)
                {
                    pkrUniversityName.Items.Add(item.UniversityName);
                }
                pkrUniversityName.SelectedIndexChanged += (s, e) =>
                {
                    lblUniversityPickerTitle.TextColor = Color.Black;
                    lblUniversityPickerTitle.Text = pkrUniversityName.Items[pkrUniversityName.SelectedIndex].ToString();
                };
                Image imgpkrUniversityNameDropdown = new Image { Source = "dropdownPicker.png", HorizontalOptions = LayoutOptions.EndAndExpand };

                StackLayout spkrUniversityName = new StackLayout { Children = { lblUniversityPickerTitle, pkrUniversityName, imgpkrUniversityNameDropdown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(0, 5, 0, 5) };
                Frame frmpkrUniversityName = new Frame { Content = spkrUniversityName, BackgroundColor = Color.White, Padding = new Thickness(Device.OnPlatform(8, 5, 0)), HasShadow = false };

                recognizerUniversityName.NumberOfTapsRequired = 1; // single-tap
                recognizerUniversityName.Tapped += (s, e) =>
                {
                    pkrUniversityName.Focus();
                };
                frmpkrUniversityName.GestureRecognizers.Add(recognizerUniversityName);
                Seperator universityNameSeparator = new Seperator();
                #endregion

                #region college name
                Label lblCollegePickerTitle = new Label { Text = "College Name", TextColor = Color.Gray };
                pkrCollegeName = new Picker { IsVisible = false };
                pkrCollegeName.Title = "College Name";
                foreach (College item in college)
                {
                    pkrCollegeName.Items.Add(item.CollegeName);
                }
                pkrCollegeName.SelectedIndexChanged += (s, e) =>
                {
                    lblCollegePickerTitle.TextColor = Color.Black;
                    lblCollegePickerTitle.Text = pkrCollegeName.Items[pkrCollegeName.SelectedIndex].ToString();
                };
                Image imgCollegeNameDropdown = new Image { Source = "dropdownPicker.png", HorizontalOptions = LayoutOptions.EndAndExpand };

                StackLayout sCollegeName = new StackLayout { Children = { lblCollegePickerTitle, pkrCollegeName, imgCollegeNameDropdown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(0, 5, 0, 5) };
                Frame frmCollegeName = new Frame { Content = sCollegeName, BackgroundColor = Color.White, Padding = new Thickness(Device.OnPlatform(8, 5, 0)), HasShadow = false };

                recognizerCollegeName.NumberOfTapsRequired = 1; // single-tap
                recognizerCollegeName.Tapped += (s, e) =>
                {
                    pkrCollegeName.Focus();
                };
                frmCollegeName.GestureRecognizers.Add(recognizerCollegeName);
                Seperator collegeNameSeparator = new Seperator();
                #endregion

                #region qualification
                Label lblQualificationPickerTitle = new Label { Text = "Qualification", TextColor = Color.Gray, FontSize = Device.OnPlatform(11, 14, 14) };
                pkrQualification = new Picker { IsVisible = false };
                pkrQualification.Title = "Qualification";
                foreach (Qualification item in qualifications)
                {
                    pkrQualification.Items.Add(item.QualificationName);
                }
                pkrQualification.SelectedIndexChanged += (s, e) =>
                {
                    lblQualificationPickerTitle.TextColor = Color.Black;
                    lblQualificationPickerTitle.Text = pkrQualification.Items[pkrQualification.SelectedIndex].ToString();
                };
                Image imgQualificationDropdown = new Image { Source = "dropdownPicker.png", HorizontalOptions = LayoutOptions.EndAndExpand };

                StackLayout sQualificationName = new StackLayout { Children = { lblQualificationPickerTitle, pkrQualification, imgQualificationDropdown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(0, 5, 0, 5) };
                Frame frmQualification = new Frame { Content = sQualificationName, BackgroundColor = Color.White, Padding = new Thickness(Device.OnPlatform(8, 5, 0)), HasShadow = false };

                recognizerQualification.NumberOfTapsRequired = 1; // single-tap
                recognizerQualification.Tapped += (s, e) =>
                {
                    pkrQualification.Focus();
                };
                frmQualification.GestureRecognizers.Add(recognizerQualification);
                Seperator qualificationSeparator = new Seperator();
                #endregion

                #region degree
                Label lblDegreePickerTitle = new Label { Text = "Degree", TextColor = Color.Gray };
                pkrDegree = new Picker { IsVisible = false };
                pkrDegree.Title = "Degree";
                foreach (Degree item in degrees)
                {
                    pkrDegree.Items.Add(item.DegreeName);
                }
                pkrDegree.SelectedIndexChanged += (s, e) =>
                {
                    lblDegreePickerTitle.TextColor = Color.Black;
                    lblDegreePickerTitle.Text = pkrDegree.Items[pkrDegree.SelectedIndex].ToString();
                };
                Image imgDegreeDropdown = new Image { Source = "dropdownPicker.png", HorizontalOptions = LayoutOptions.EndAndExpand };

                StackLayout sDegreeName = new StackLayout { Children = { lblDegreePickerTitle, pkrDegree, imgDegreeDropdown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(0, 5, 0, 5) };
                Frame frmDegree = new Frame { Content = sDegreeName, BackgroundColor = Color.White, Padding = new Thickness(Device.OnPlatform(8, 5, 0)), HasShadow = false };

                recognizerDegree.NumberOfTapsRequired = 1; // single-tap
                recognizerDegree.Tapped += (s, e) =>
                {
                    pkrDegree.Focus();
                };
                frmDegree.GestureRecognizers.Add(recognizerDegree);
                Seperator degreeSeparator = new Seperator();
                #endregion

                #endregion

                #region branch
                Label lblBranchPickerTitle = new Label { Text = "Branch", TextColor = Color.Gray };
                pkrBranch = new Picker { IsVisible = false };
                pkrBranch.Title = "Branch";
                foreach (Streams item in streamList)
                {
                    pkrBranch.Items.Add(item.StreamName);
                }
                pkrBranch.SelectedIndexChanged += (s, e) =>
                {
                    lblBranchPickerTitle.TextColor = Color.Black;
                    lblBranchPickerTitle.Text = pkrBranch.Items[pkrBranch.SelectedIndex].ToString();
                };
                Image imgBranchDropdown = new Image { Source = "dropdownPicker.png", HorizontalOptions = LayoutOptions.EndAndExpand };

                StackLayout sBranchName = new StackLayout { Children = { lblBranchPickerTitle, pkrBranch, imgBranchDropdown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(0, 5, 0, 5) };
                Frame frmBranch = new Frame { Content = sBranchName, BackgroundColor = Color.White, Padding = new Thickness(Device.OnPlatform(8, 5, 0)), HasShadow = false };

                recognizerBranch.NumberOfTapsRequired = 1;
                recognizerBranch.Tapped += (s, e) =>
                {
                    pkrBranch.Focus();
                };
                frmBranch.GestureRecognizers.Add(recognizerBranch);

                //txtBranch = new CustomEntryForGeneralPurpose { Placeholder = "Branch", HorizontalOptions = LayoutOptions.FillAndExpand };

                //StackLayout sBranch = new StackLayout
                //{
                //    Children = { txtBranch },
                //    Orientation = StackOrientation.Horizontal,
                //    Padding = new Thickness(0, 0, 0, 0)
                //};
                Seperator seperatorBranch = new Seperator();
                #endregion

                #region duration
                Label lblDuration = new Label { Text = "Duration", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray, WidthRequest = 80, HeightRequest = 30 };
                StackLayout slblDuration = new StackLayout
                {
                    Children = { lblDuration },
                    Orientation = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.End,
                    Margin = new Thickness(3, 8, 0, 0)
                };

                lblFromDateText = new Label { Text = "From", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray };

                StackLayout sLblFromDateText = new StackLayout
                {
                    Children = { lblFromDateText },
                    Orientation = StackOrientation.Horizontal,
                    Margin = new Thickness(0, 8, 0, 0)
                };

                Image imgFromDateArrow = new Image { Source = "calendar.png", HorizontalOptions = LayoutOptions.End };

                StackLayout slFromDateTap = new StackLayout { Children = { sLblFromDateText, imgFromDateArrow }, Orientation = StackOrientation.Horizontal };

                DatePicker dtFromDate = new DatePicker { IsVisible = false, BackgroundColor = Color.White };
                var fromDateTapGestureRecognizer = new TapGestureRecognizer();

                fromDateTapGestureRecognizer.NumberOfTapsRequired = 1; // single-tap
                fromDateTapGestureRecognizer.Tapped += (s, e) =>
                {
                    dtFromDate.Focus();
                };

                slFromDateTap.GestureRecognizers.Add(fromDateTapGestureRecognizer);

                dtFromDate.DateSelected += (object sender, DateChangedEventArgs e) =>
                {
                    //lblFromDateText.Text = e.NewDate.ToString("dd-MM-yyyy");
                    lblFromDateText.Text = e.NewDate.ToString("yyyy-MM-dd");
                };

                //To date
                lblToDateText = new Label { Text = "To", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray };

                StackLayout sLblToDateText = new StackLayout
                {
                    Children = { lblToDateText },
                    Orientation = StackOrientation.Horizontal,
                    Margin = new Thickness(0, 8, 0, 0)
                };

                Image imgToDateArrow = new Image { Source = "calendar.png", HorizontalOptions = LayoutOptions.End };

                StackLayout slToDateTap = new StackLayout { Children = { sLblToDateText, imgToDateArrow }, Orientation = StackOrientation.Horizontal };

                DatePicker dtToDate = new DatePicker { IsVisible = false, BackgroundColor = Color.White };
                var toDateTapGestureRecognizer = new TapGestureRecognizer();

                toDateTapGestureRecognizer.NumberOfTapsRequired = 1; // single-tap
                toDateTapGestureRecognizer.Tapped += (s, e) =>
                {
                    dtToDate.Focus();
                };

                slToDateTap.GestureRecognizers.Add(toDateTapGestureRecognizer);

                dtToDate.DateSelected += (object sender, DateChangedEventArgs e) =>
                {
                    //lblToDateText.Text = e.NewDate.ToString("dd-MM-yyyy");
                    lblToDateText.Text = e.NewDate.ToString("yyyy-MM-dd");
                };

                Label lblFromToTo = new Label { Text = "-", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray };

                StackLayout sLblFromToTo = new StackLayout
                {
                    Children = { lblFromToTo },
                    Orientation = StackOrientation.Horizontal,
                    Margin = new Thickness(0, 8, 0, 0)
                };

                StackLayout sWorkDuration = new StackLayout
                {
                    Children = { slblDuration, slFromDateTap, dtFromDate, sLblFromToTo, slToDateTap, dtToDate },
                    Orientation = StackOrientation.Horizontal,
                    Padding = new Thickness(0, 0, 0, 0)
                };
                Seperator sDuration = new Seperator();
                #endregion

                #region percentage, project info, aftersave response, button
                txtPercentage = new CustomEntryForGeneralPurpose { Placeholder = "Percentage", HorizontalOptions = LayoutOptions.FillAndExpand, Keyboard = Keyboard.Numeric };
                txtPercentage.Behaviors.Add(new DecimalNumberValidationBehaviour());
                StackLayout sPercentage = new StackLayout
                {
                    Children = { txtPercentage },
                    Orientation = StackOrientation.Horizontal,
                    Padding = new Thickness(0, 0, 0, 0)
                };
                Seperator sPercentageText = new Seperator();
                txtProjectInformation = new CustomEntryForGeneralPurpose { Placeholder = "Project Information", HorizontalOptions = LayoutOptions.FillAndExpand };
                StackLayout sProjectInformation = new StackLayout
                {
                    Children = { txtProjectInformation },
                    Orientation = StackOrientation.Horizontal,
                    Padding = new Thickness(0, 0, 0, 0)
                };
                Seperator sProjectInfo = new Seperator();
                Label AfterSaveResponse = new Label { Text = "", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.Green };
                StackLayout slAfterSaveResponse = new StackLayout
                {
                    Children = { AfterSaveResponse },
                    Orientation = StackOrientation.Horizontal,
                    Margin = new Thickness(0, 8, 0, 0)
                };

                Button btnSaveData = new Button { Text = "SAVE", HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.FromHex("f7cc59"), TextColor = Color.Black, BorderRadius = 50, WidthRequest = 270, FontAttributes = FontAttributes.Bold };
                StackLayout sbtnSaveData = new StackLayout
                {
                    Children = { btnSaveData },
                    Orientation = StackOrientation.Horizontal,
                    Padding = new Thickness(0, 10, 0, 8)
                };
                #endregion

                #region listView

                Label lblAddNewEducationDetail = new Label { Text = "Add new education detail information here", HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f"), FontSize = 14, FontAttributes = FontAttributes.Bold };
                StackLayout slblAddNewEducationDetail = new StackLayout
                {
                    Children = { lblAddNewEducationDetail },
                    Orientation = StackOrientation.Horizontal,
                    Padding = new Thickness(0, 20, 0, 0)
                };

                StackLayout slHeaderText = new StackLayout();
                Label lblColege = new Label { Text = "College", FontAttributes = FontAttributes.Bold, WidthRequest = 130, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f") };
                Label lblpkrDegree = new Label { Text = "Degree", FontAttributes = FontAttributes.Bold, WidthRequest = 130, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f") };
                Label lblPercentage = new Label { Text = "Percentage", FontAttributes = FontAttributes.Bold, WidthRequest = 130, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f") };
                Label lblEmpty = new Label { Text = "", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black };
                slHeaderText = new StackLayout
                {
                    Children = { lblColege, lblpkrDegree, lblPercentage, lblEmpty },
                    Orientation = StackOrientation.Horizontal,
                    Padding = new Thickness(0, 0, 0, 0)
                };
                if(educationList.Count == 0)
                {
                    slHeaderText.IsVisible = false;
                    sListViewHeader.IsVisible = false;
                }


                educationObservableCollection = educationList;

                listView.ItemsSource = educationObservableCollection;
                listView.ItemTemplate = new DataTemplate(() => new EducationCell(educationObservableCollection, college, qualifications));
                listView.HeightRequest = 50 * educationList.Count;
                StackLayout sListView = new StackLayout
                {
                    Children = { listView },
                    Orientation = StackOrientation.Horizontal,
                    Padding = new Thickness(0, 0, 0, 0)
                };

                #endregion

                #region stack layout, scroll view and content

                slEducationAllInformationAdd = new StackLayout
                {
                    Children = {slblAddNewEducationDetail,
                    frmpkrUniversityName, universityNameSeparator, frmCollegeName, collegeNameSeparator,
                    frmQualification, qualificationSeparator,
                    frmDegree, degreeSeparator, frmBranch, seperatorBranch,
                    sWorkDuration, sDuration, sPercentage, sPercentageText,
                        sProjectInformation, sProjectInfo, slAfterSaveResponse, sbtnSaveData }
                };
                slEducationAllInformationAdd.IsVisible = false;
                btnAddNewWorkExp.Clicked += (object sender, EventArgs e) =>
                {
                    slEducationAllInformationAdd.IsVisible = true;
                };

                StackLayout slEducationDetailsInformation = new StackLayout
                {
                    Children = { sBtnAddNewWorkExp, sEducationDetailInfo, slHeaderText, sListViewHeader, sListView, slEducationAllInformationAdd },
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Padding = new Thickness(20, 0, 20, 30),
                    BackgroundColor = Color.White
                };

                ScrollView svEducationDetails = new ScrollView { Content = slEducationDetailsInformation };

                Content = svEducationDetails;
                #endregion

                #region posting data
                Education education = new Education();

                btnSaveData.Clicked += (object sender, EventArgs e) =>
                {
                    if (Validate())
                    {
                        if (DateTime.Parse(lblFromDateText.Text) > DateTime.Parse(lblToDateText.Text))
                        {
                            DisplayAlert("Error", "Start date can not be greater than end date.", "OK");
                        }
                        else
                        {
                            education.UserId = ACTContext.userId;
                            education.CollegeId = (from c in college where c.CollegeName == pkrCollegeName.Items[pkrCollegeName.SelectedIndex] select c.Id).SingleOrDefault();
                            education.BranchId = (from d in streamList where d.StreamName == pkrBranch.Items[pkrBranch.SelectedIndex] select d.StreamID).SingleOrDefault();
                            education.DegreeId = (from d in degrees where d.DegreeName == pkrDegree.Items[pkrDegree.SelectedIndex] select d.Id).SingleOrDefault();
                            education.QualificationId = (from q in qualifications where q.QualificationName == pkrQualification.Items[pkrQualification.SelectedIndex] select q.Id).SingleOrDefault();
                            education.FromDate = DateTime.Parse(lblFromDateText.Text);
                            education.ToDate = DateTime.Parse(lblToDateText.Text);
                            education.Percentage = decimal.Parse(txtPercentage.Text);
                            education.ProjectInfo = txtProjectInformation.Text;

                            slHeaderText.IsVisible = true;
                            sListViewHeader.IsVisible = true;

                            Device.BeginInvokeOnMainThread(async () =>
                            {
                                var result = await Service.PostEducationDetail(education);
                                AfterSaveResponse.Text = "Data saved";
                                txtPercentage.Text = string.Empty;
                                txtProjectInformation.Text = string.Empty;

                                lblUniversityPickerTitle.Text = "University";
                                lblUniversityPickerTitle.TextColor = Color.Gray;
                                pkrUniversityName.IsVisible = false;

                                lblCollegePickerTitle.Text = "College";
                                lblCollegePickerTitle.TextColor = Color.Gray;
                                pkrCollegeName.IsVisible = false;

                                lblQualificationPickerTitle.Text = "Qualification";
                                lblQualificationPickerTitle.TextColor = Color.Gray;
                                pkrQualification.IsVisible = false;

                                lblDegreePickerTitle.Text = "Degree";
                                lblDegreePickerTitle.TextColor = Color.Gray;
                                pkrDegree.IsVisible = false;

                                lblBranchPickerTitle.Text = "Branch";
                                lblBranchPickerTitle.TextColor = Color.Gray;
                                pkrBranch.IsVisible = false;

                                var resultUpdated = await Service.GetEducationDetails(ACTContext.userId);
                                if (resultUpdated != null)
                                {
                                    educationList = (List<Education>)JsonConvert.DeserializeObject<List<Education>>(resultUpdated);
                                }
                                educationObservableCollection = educationList;
                                listView.ItemsSource = educationObservableCollection;
                                listView.HeightRequest = 50 * educationList.Count;
                                listView.ItemTemplate = new DataTemplate(() => new EducationCell(educationObservableCollection, college, qualifications));
                            });
                        }
                        
                    };

                };
                #endregion

            }
            else
            {
                Navigation.PushModalAsync(new Login());
            }
        }
        public void InterviewDetailsLayout(List <CandidateDetails> candidate, Candidate candidate2)
        {
            if (ACTContext.isLogin == true)
            {
                #region Header text
                Label lblInterviewDetailsInfo = new Label {
                    Text = "Interview Details Information", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex("5e247f"), FontSize = 18, FontAttributes = FontAttributes.Bold, HeightRequest = 30
                };
                Label interviewDetailsInfo = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, HeightRequest = 40
                };
                StackLayout sInterviewDetailInfo = new StackLayout
                {
                    Children    = { lblInterviewDetailsInfo, interviewDetailsInfo },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 30, 0, 0)
                };
                #endregion

                #region candidate name
                Label lblCandidatePickerTitle = new Label {
                    Text = "Candidate Name", TextColor = Color.Gray
                };
                pkrCandidateName = new Picker {
                    IsVisible = false
                };
                pkrCandidateName.Title = "Candidate Name";
                foreach (CandidateDetails item in candidate)
                {
                    pkrCandidateName.Items.Add(item.CandidateName.ToString());
                }
                pkrCandidateName.SelectedIndexChanged += (s, e) =>
                {
                    lblCandidatePickerTitle.TextColor = Color.Black;
                    lblCandidatePickerTitle.Text      = pkrCandidateName.Items[pkrCandidateName.SelectedIndex].ToString();
                };
                Image imgPkrCandidateNameDropdown = new Image {
                    Source = "dropdownPicker.png", HorizontalOptions = LayoutOptions.EndAndExpand
                };

                StackLayout sPkrCandidateName = new StackLayout {
                    Children = { lblCandidatePickerTitle, pkrCandidateName, imgPkrCandidateNameDropdown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(0, 5, 0, 5)
                };
                Frame frmPkrCandidateName = new Frame {
                    Content = sPkrCandidateName, BackgroundColor = Color.White, Padding = new Thickness(Device.OnPlatform(8, 5, 0)), HasShadow = false
                };

                recognizerCandidateName.NumberOfTapsRequired = 1; // single-tap
                recognizerCandidateName.Tapped += (s, e) =>
                {
                    pkrCandidateName.Focus();
                };
                frmPkrCandidateName.GestureRecognizers.Add(recognizerCandidateName);
                Seperator candidateNameSeparator = new Seperator();

                //Button for submit candidate name and fetch particular data regarding the candidate
                Button btnSubmitCandidate = new Button {
                    Text = "Submit", HorizontalOptions = LayoutOptions.StartAndExpand, BackgroundColor = Color.FromHex("4690FB"), TextColor = Color.White, BorderRadius = 10, WidthRequest = 80, FontAttributes = FontAttributes.None, HeightRequest = 40
                };
                StackLayout sBtnSubmitCandidate = new StackLayout
                {
                    Children    = { btnSubmitCandidate },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 5, 0, 5)
                };

                #endregion

                #region candidate information

                #region first name
                //First Name
                Label lblCandidateFirstName = new Label {
                    Text = "First name : ", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, WidthRequest = 90
                };
                Label lblCandidateFirstNameText = new Label {
                    Text = "demo demo demo", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black
                };
                StackLayout slblCandidateFirstName = new StackLayout
                {
                    Children          = { lblCandidateFirstName, lblCandidateFirstNameText },
                    Orientation       = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.StartAndExpand,
                    Margin            = new Thickness(0, 10, 0, 10)
                };
                Seperator separatorFirstName = new Seperator();
                #endregion

                #region last name
                //Last Name
                Label lblCandidateLastName = new Label {
                    Text = "Last name : ", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, WidthRequest = 90
                };
                Label lblCandidateLastNameText = new Label {
                    Text = "demo demo", HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.Black
                };
                StackLayout slblCandidateLastName = new StackLayout
                {
                    Children          = { lblCandidateLastName, lblCandidateLastNameText },
                    Orientation       = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.StartAndExpand,
                    Margin            = new Thickness(0, 10, 0, 10)
                };
                Seperator separatorLastName = new Seperator();
                #endregion

                #region address
                //Address
                Label lblCandidateAddress = new Label {
                    Text = "Address : ", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, WidthRequest = 90
                };
                Label lblCandidateAddressText = new Label {
                    Text = "demo address", HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.Black
                };
                StackLayout slblCandidateAddress = new StackLayout
                {
                    Children          = { lblCandidateAddress, lblCandidateAddressText },
                    Orientation       = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.StartAndExpand,
                    Margin            = new Thickness(0, 10, 0, 10)
                };
                Seperator separatorAddress = new Seperator();
                #endregion

                #region educational qualification
                //Educational qualification
                Label lblCandidateEducationalQualification = new Label {
                    Text = "Educational Qualification : ", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, WidthRequest = 90
                };
                Label lblCandidateEducationalQualificationText = new Label {
                    Text = "demo qualification", HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.Black
                };
                StackLayout slblCandidateEducationalQualification = new StackLayout
                {
                    Children          = { lblCandidateEducationalQualification, lblCandidateEducationalQualificationText },
                    Orientation       = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.StartAndExpand,
                    Margin            = new Thickness(0, 10, 0, 10)
                };
                Seperator separatorEducationalQualification = new Seperator();
                #endregion

                #region listview for line items
                Label lblListViewHeader = new Label {
                    Text = "Give parameter wise rating and remark", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex("5e247f"), FontSize = 14, FontAttributes = FontAttributes.Bold
                };
                StackLayout slblListViewHeader = new StackLayout
                {
                    Children = { lblListViewHeader },
                    Padding  = new Thickness(0, 10, 0, 10)
                };

                List <LineItem> lineItemObservableCollection = new List <LineItem>();
                lineItemObservableCollection = interviewsModel.LineItemList;
                ListView listView = new ListView();

                listView.SeparatorColor = Color.Gray;
                listView.HeightRequest  = 50 * interviewsModel.LineItemList.Count;
                StackLayout sListView = new StackLayout
                {
                    Children    = { listView },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 10, 0, 10)
                };
                #endregion

                #region overall remark
                txtRemark = new CustomEntryForGeneralPurpose {
                    Placeholder = "Overall Remark", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sRemark = new StackLayout
                {
                    Children    = { txtRemark },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                Seperator seperatorRemark = new Seperator();
                #endregion

                #region seleted or not
                Label lblCandidateSelected = new Label {
                    Text = "Selected", HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.Black, WidthRequest = 80
                };
                Switch switchForLblCandidateSelected = new Switch {
                    MinimumWidthRequest = 50, HorizontalOptions = LayoutOptions.StartAndExpand, BackgroundColor = Color.Transparent
                };
                StackLayout sSwithForCandidateSelected = new StackLayout
                {
                    Children    = { lblCandidateSelected, switchForLblCandidateSelected },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 10, 0, 10)
                };
                #endregion

                #region after response
                Label AfterSaveResponse = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.Green
                };
                StackLayout slAfterSaveResponse = new StackLayout
                {
                    Children    = { AfterSaveResponse },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };
                #endregion

                #region save button
                Button btnSaveData = new Button {
                    Text = "SAVE", HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.FromHex("f7cc59"), TextColor = Color.Black, BorderRadius = 50, WidthRequest = 270, FontAttributes = FontAttributes.Bold
                };
                StackLayout sbtnSaveData = new StackLayout
                {
                    Children    = { btnSaveData },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 10, 0, 8)
                };
                #endregion

                #region candidate information stack layout
                slCandidateInformation = new StackLayout
                {
                    Children = { slblCandidateFirstName,                separatorFirstName,
                                 slblCandidateLastName,                 separatorLastName,
                                 slblCandidateAddress,                  separatorAddress,
                                 slblCandidateEducationalQualification, separatorEducationalQualification,
                                 slblListViewHeader,                    sListView,
                                 sRemark,                               seperatorRemark,
                                 sSwithForCandidateSelected,
                                 slAfterSaveResponse,                   sbtnSaveData }
                };
                slCandidateInformation.IsVisible = false;
                #endregion

                #region submit button click
                btnSubmitCandidate.Clicked += (object sender, EventArgs e) =>
                {
                    if (Validate())
                    {
                        slCandidateInformation.IsVisible = true;
                        int interviewId = (from c in candidate where c.CandidateName == pkrCandidateName.Items[pkrCandidateName.SelectedIndex] select c.InterviewId).SingleOrDefault();
                        Device.BeginInvokeOnMainThread(async() =>
                        {
                            var result = await Service.GetCandidateInformation(interviewId, ACTContext.interviewerId);
                            if (result != null)
                            {
                                interviewsModel = JsonConvert.DeserializeObject <InterviewsModel>(result);
                            }
                            lblCandidateFirstNameText.Text = interviewsModel.FirstName;
                            lblCandidateLastNameText.Text  = interviewsModel.LastName;
                            lblCandidateAddressText.Text   = interviewsModel.Address1;
                            lblCandidateEducationalQualificationText.Text = interviewsModel.QualificationName;
                            lineItemObservableCollection = interviewsModel.LineItemList;

                            listView.HeightRequest = 50 * interviewsModel.LineItemList.Count;

                            listView.ItemsSource  = lineItemObservableCollection;
                            listView.ItemTemplate = new DataTemplate(() => new LineItemCell(lineItemObservableCollection));
                        });
                    }
                };
                #endregion
                #endregion

                #region stack layouts and contents
                StackLayout slUserDetailsInformation = new StackLayout
                {
                    Children = { sInterviewDetailInfo, frmPkrCandidateName, candidateNameSeparator,
                                 sBtnSubmitCandidate,
                                 slCandidateInformation },
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    Padding           = new Thickness(20, 0, 20, 30),
                    BackgroundColor   = Color.White
                };

                ScrollView svUserDetails = new ScrollView {
                    Content = slUserDetailsInformation
                };

                Content = svUserDetails;

                Interview interview = new Interview();
                #endregion

                #region post data
                btnSaveData.Clicked += (object sender, EventArgs e) =>
                {
                    Device.BeginInvokeOnMainThread(async() =>
                    {
                        int interviewId2      = (from c in candidate where c.CandidateName == pkrCandidateName.Items[pkrCandidateName.SelectedIndex] select c.InterviewId).SingleOrDefault();
                        var resultForPostData = await Service.GetCandidateInformation(interviewId2, ACTContext.interviewerId);
                        if (resultForPostData != null)
                        {
                            interviewsModel = JsonConvert.DeserializeObject <InterviewsModel>(resultForPostData);
                        }
                        interviewsModel.OvarAllRemarks = txtRemark.Text;
                        for (int i = 0; i < ACTContext.ratingDetailsListContext.Count; i++)
                        {
                            interviewsModel.RatingList.Add(ACTContext.ratingDetailsListContext[i]);
                        }

                        if (switchForLblCandidateSelected.IsToggled == true)
                        {
                            interviewsModel.IsSelected = 1;
                        }
                        if (switchForLblCandidateSelected.IsToggled == false)
                        {
                            interviewsModel.IsSelected = 0;
                        }
                        var resultAfterPostData = await Service.PostInterviewDetails(interviewsModel);
                        AfterSaveResponse.Text  = "Data saved successfully";
                        txtRemark.Text          = string.Empty;
                        interviewsModel.RatingList.Clear();
                        ACTContext.ratingDetailsListContext.Clear();

                        lineItemObservableCollection = interviewsModel.LineItemList;

                        listView.ItemsSource  = lineItemObservableCollection;
                        listView.ItemTemplate = new DataTemplate(() => new LineItemCell(lineItemObservableCollection));
                    });
                };
                #endregion
            }
            else
            {
                Navigation.PushModalAsync(new Login());
            }
        }
Пример #4
0
        public void WorkExperienceLayout(List <WorkExperienceModel> workExperienceList)
        {
            if (ACTContext.isLogin == true)
            {
                #region work experience and onsite labels add button
                Label lblOnsiteSwithInfo = new Label {
                    Text = "Onsite Information ", HorizontalOptions = LayoutOptions.EndAndExpand, TextColor = Color.FromHex("5e247f"), FontSize = 12, FontAttributes = FontAttributes.Bold
                };
                Switch switchForOnsite1 = new Switch {
                    HorizontalOptions = LayoutOptions.End, BackgroundColor = Color.Transparent
                };
                StackLayout sSwithForOnsite = new StackLayout
                {
                    Children    = { lblOnsiteSwithInfo, switchForOnsite1 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 20, 0, 0)
                };
                Button btnAddNewWorkExp = new Button {
                    Text = "Add work experience", HorizontalOptions = LayoutOptions.EndAndExpand, BackgroundColor = Color.FromHex("4690FB"), TextColor = Color.White, BorderRadius = 10, HeightRequest = 35, FontSize = 10, FontAttributes = FontAttributes.Bold
                };
                StackLayout sBtnAddNewWorkExp = new StackLayout
                {
                    Children    = { btnAddNewWorkExp },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(2, 5, 2, 5)
                };


                Label lblCompanyWorkExperienceInfo = new Label {
                    Text = "Work Experience Information", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex("5e247f"), FontSize = 18, FontAttributes = FontAttributes.Bold, HeightRequest = 30
                };
                Label companyWorkExperience = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, HeightRequest = 40
                };
                StackLayout sCompanyWorkExperience = new StackLayout
                {
                    Children    = { lblCompanyWorkExperienceInfo, companyWorkExperience },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 20, 0, 0)
                };

                Label lblOnsiteInformation = new Label {
                    Text = "Onsite Information", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex("5e247f"), FontSize = 14, FontAttributes = FontAttributes.Bold, WidthRequest = 125, HeightRequest = 30
                };
                StackLayout sOnsiteInformation = new StackLayout
                {
                    Children    = { lblOnsiteInformation },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 20, 0, 0)
                };
                #endregion

                #region separator
                BoxView separator1 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator1 = new StackLayout
                {
                    Children    = { separator1 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator2 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator2 = new StackLayout
                {
                    Children    = { separator2 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator3 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator3 = new StackLayout
                {
                    Children    = { separator3 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator4 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator4 = new StackLayout
                {
                    Children    = { separator4 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator5 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator5 = new StackLayout
                {
                    Children    = { separator5 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator6 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator6 = new StackLayout
                {
                    Children    = { separator6 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator7 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator7 = new StackLayout
                {
                    Children    = { separator7 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator8 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator8 = new StackLayout
                {
                    Children    = { separator8 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator9 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator9 = new StackLayout
                {
                    Children    = { separator9 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator10 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator10 = new StackLayout
                {
                    Children    = { separator10 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator11 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator11 = new StackLayout
                {
                    Children    = { separator11 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator12 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator12 = new StackLayout
                {
                    Children    = { separator12 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separatorListview = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparatorListview = new StackLayout
                {
                    Children    = { separatorListview },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                BoxView separatorListviewOnsite = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparatorListviewOnsite = new StackLayout
                {
                    Children    = { separatorListviewOnsite },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                #endregion

                #region company name, designation, role

                Label lblAddNewWorkExp = new Label {
                    Text = "Add new work experience information here", HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f"), FontSize = 14, FontAttributes = FontAttributes.Bold
                };
                StackLayout slblAddNewWorkExp = new StackLayout
                {
                    Children    = { lblAddNewWorkExp },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 20, 0, 0)
                };

                CompanyName = new CustomEntryForGeneralPurpose {
                    Placeholder = "Company Name", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sCompanyName = new StackLayout
                {
                    Children    = { CompanyName },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                workDesignation = new CustomEntryForGeneralPurpose {
                    Placeholder = "Designation", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sWorkDesignation = new StackLayout
                {
                    Children    = { workDesignation },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                workRole = new CustomEntryForGeneralPurpose {
                    Placeholder = "Role", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sWorkRole = new StackLayout
                {
                    Children    = { workRole },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                #endregion

                #region duration
                Label lblWorkDuration = new Label {
                    Text = "Duration", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray, WidthRequest = 80, HeightRequest = 30
                };
                StackLayout slblWorkDuration = new StackLayout
                {
                    Children    = { lblWorkDuration },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };
                lblFromDateText = new Label {
                    Text = "From", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout sLblFromDateText = new StackLayout
                {
                    Children    = { lblFromDateText },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                Image imgFromDateArrow = new Image {
                    Source = "calendar.png", HorizontalOptions = LayoutOptions.End
                };

                StackLayout slFromDateTap = new StackLayout {
                    Children = { sLblFromDateText, imgFromDateArrow }, Orientation = StackOrientation.Horizontal
                };

                DatePicker dtFromDate = new DatePicker {
                    IsVisible = false, BackgroundColor = Color.White
                };
                var fromDateTapGestureRecognizer = new TapGestureRecognizer();

                fromDateTapGestureRecognizer.NumberOfTapsRequired = 1; // single-tap
                fromDateTapGestureRecognizer.Tapped += (s, e) =>
                {
                    dtFromDate.Focus();
                };

                slFromDateTap.GestureRecognizers.Add(fromDateTapGestureRecognizer);

                dtFromDate.DateSelected += (object sender, DateChangedEventArgs e) =>
                {
                    lblFromDateText.Text = e.NewDate.ToString("yyyy-MM-dd");
                };

                //To date
                lblToDateText = new Label {
                    Text = "To", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout sLblToDateText = new StackLayout
                {
                    Children    = { lblToDateText },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                Image imgToDateArrow = new Image {
                    Source = "calendar.png", HorizontalOptions = LayoutOptions.End
                };

                StackLayout slToDateTap = new StackLayout {
                    Children = { sLblToDateText, imgToDateArrow }, Orientation = StackOrientation.Horizontal
                };

                DatePicker dtToDate = new DatePicker {
                    IsVisible = false, BackgroundColor = Color.White
                };
                var toDateTapGestureRecognizer = new TapGestureRecognizer();

                toDateTapGestureRecognizer.NumberOfTapsRequired = 1; // single-tap
                toDateTapGestureRecognizer.Tapped += (s, e) =>
                {
                    dtToDate.Focus();
                };

                slToDateTap.GestureRecognizers.Add(toDateTapGestureRecognizer);

                dtToDate.DateSelected += (object sender, DateChangedEventArgs e) =>
                {
                    lblToDateText.Text = e.NewDate.ToString("yyyy-MM-dd");
                };

                Label lblFromToTo = new Label {
                    Text = "-", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout sLblFromToTo = new StackLayout
                {
                    Children    = { lblFromToTo },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                StackLayout sWorkDuration = new StackLayout
                {
                    Children    = { slblWorkDuration, slFromDateTap, dtFromDate, sLblFromToTo, slToDateTap, dtToDate },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(3, 0, 0, 0)
                };
                #endregion duration

                #region contacts
                workReferenceContact = new CustomEntryForGeneralPurpose {
                    Placeholder = "Reference Contact", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sWorkReferenceContact = new StackLayout
                {
                    Children    = { workReferenceContact },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                workPhoneNo = new CustomEntryForGeneralPurpose {
                    Placeholder = "Phone No", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sWorkPhoneNo = new StackLayout
                {
                    Children    = { workPhoneNo },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                #endregion

                #region worked company and location

                Label lblAddNewOnsiteInfo = new Label {
                    Text = "Add new onsite detail information here", HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f"), FontSize = 14, FontAttributes = FontAttributes.Bold
                };
                StackLayout slblAddNewOnsiteInfo = new StackLayout
                {
                    Children    = { lblAddNewOnsiteInfo },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 20, 0, 0)
                };

                onsiteWorkedCompany = new CustomEntryForGeneralPurpose {
                    Placeholder = "Worked Company", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sOnsiteWorkedCompany = new StackLayout
                {
                    Children    = { onsiteWorkedCompany },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };


                onsiteWorkedCompanyLocation = new CustomEntryForGeneralPurpose {
                    Placeholder = "Location", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sOnsiteWorkedCompanyLocation = new StackLayout
                {
                    Children    = { onsiteWorkedCompanyLocation },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                #endregion

                #region duration
                Label lblOnsiteWorkedCompanyDuration = new Label {
                    Text = "Duration", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray, WidthRequest = 80, HeightRequest = 30
                };
                StackLayout slblOnsiteWorkedCompanyDuration = new StackLayout
                {
                    Children    = { lblOnsiteWorkedCompanyDuration },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                lblFromDateOnsiteText = new Label {
                    Text = "From", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout slblFromDateOnsiteText = new StackLayout
                {
                    Children    = { lblFromDateOnsiteText },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                Image imgFromDateOnsiteArrow = new Image {
                    Source = "calendar.png", HorizontalOptions = LayoutOptions.End
                };

                StackLayout slFromDateOnsiteTap = new StackLayout {
                    Children = { slblFromDateOnsiteText, imgFromDateOnsiteArrow }, Orientation = StackOrientation.Horizontal
                };

                DatePicker dtFromOnsiteDate = new DatePicker {
                    IsVisible = false, BackgroundColor = Color.White
                };
                var fromDateOnsiteTapGestureRecognizer = new TapGestureRecognizer();

                fromDateOnsiteTapGestureRecognizer.NumberOfTapsRequired = 1; // single-tap
                fromDateOnsiteTapGestureRecognizer.Tapped += (s, e) =>
                {
                    dtFromOnsiteDate.Focus();
                };

                slFromDateOnsiteTap.GestureRecognizers.Add(fromDateOnsiteTapGestureRecognizer);

                dtFromOnsiteDate.DateSelected += (object sender, DateChangedEventArgs e) =>
                {
                    lblFromDateOnsiteText.Text = e.NewDate.ToString("yyyy-MM-dd");
                };

                //To date
                lblToDateOnsiteText = new Label {
                    Text = "To", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout slblToDateOnsiteText = new StackLayout
                {
                    Children    = { lblToDateOnsiteText },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                Image imgToDateOnsiteArrow = new Image {
                    Source = "calendar.png", HorizontalOptions = LayoutOptions.End
                };

                StackLayout slToDateOnsiteTap = new StackLayout {
                    Children = { slblToDateOnsiteText, imgToDateOnsiteArrow }, Orientation = StackOrientation.Horizontal
                };

                DatePicker dtToDateOnsite = new DatePicker {
                    IsVisible = false, BackgroundColor = Color.White
                };
                var toDateOnsiteTapGestureRecognizer = new TapGestureRecognizer();

                toDateOnsiteTapGestureRecognizer.NumberOfTapsRequired = 1; // single-tap
                toDateOnsiteTapGestureRecognizer.Tapped += (s, e) =>
                {
                    dtToDateOnsite.Focus();
                };

                slToDateOnsiteTap.GestureRecognizers.Add(toDateOnsiteTapGestureRecognizer);

                dtToDateOnsite.DateSelected += (object sender, DateChangedEventArgs e) =>
                {
                    lblToDateOnsiteText.Text = e.NewDate.ToString("yyyy-MM-dd");
                };

                Label lblFromToToOnsite = new Label {
                    Text = "-", HorizontalOptions = LayoutOptions.Center, TextColor = Color.Gray
                };

                StackLayout slblFromToToOnsite = new StackLayout
                {
                    Children    = { lblFromToToOnsite },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                StackLayout sOnsiteWorkedCompanyDuration = new StackLayout
                {
                    Children    = { slblOnsiteWorkedCompanyDuration, slFromDateOnsiteTap, dtFromOnsiteDate, slblFromToToOnsite, slToDateOnsiteTap, dtToDateOnsite },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(3, 0, 0, 0)
                };
                #endregion

                #region onsite detail, contacts
                onsiteWorkedCompanyDetail = new CustomEntryForGeneralPurpose {
                    Placeholder = "Onsite Detail", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sOnsiteWorkedCompanyDetail = new StackLayout
                {
                    Children    = { onsiteWorkedCompanyDetail },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };


                onsiteWorkedCompanyReferenceContact = new CustomEntryForGeneralPurpose {
                    Placeholder = "Reference Contact", HorizontalOptions = LayoutOptions.FillAndExpand, Keyboard = Keyboard.Numeric
                };
                onsiteWorkedCompanyReferenceContact.Behaviors.Add(new NumberValidationBehavior());
                StackLayout sOnsiteWorkedCompanyReferenceContact = new StackLayout
                {
                    Children    = { onsiteWorkedCompanyReferenceContact },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };


                onsiteWorkedCompanyPhoneNo = new CustomEntryForGeneralPurpose {
                    Placeholder = "Phone No", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sOnsiteWorkedCompanyPhoneNo = new StackLayout
                {
                    Children    = { onsiteWorkedCompanyPhoneNo },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                #endregion

                #region listView

                StackLayout slHeaderText = new StackLayout();
                Label       lblCompany   = new Label {
                    Text = "Company", FontAttributes = FontAttributes.Bold, WidthRequest = 125, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f")
                };
                Label lblRole = new Label {
                    Text = "Role", FontAttributes = FontAttributes.Bold, WidthRequest = 125, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f")
                };
                Label lblDesigation = new Label {
                    Text = "Designation", FontAttributes = FontAttributes.Bold, WidthRequest = 125, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f")
                };
                Label lblEmpty = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black
                };
                slHeaderText = new StackLayout
                {
                    Children    = { lblCompany, lblRole, lblDesigation, lblEmpty },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };

                if (workExperienceList.Count == 0)
                {
                    slHeaderText.IsVisible       = false;
                    sSeparatorListview.IsVisible = false;
                }

                listView.HeightRequest             = 50 * workExperienceList.Count;
                workExperienceObservableCollection = workExperienceList;

                listView.ItemsSource  = workExperienceObservableCollection;
                listView.ItemTemplate = new DataTemplate(() => new WorkExperienceCell(workExperienceObservableCollection));
                StackLayout sListView = new StackLayout
                {
                    Children = { listView },
                    //Orientation = StackOrientation.Horizontal,
                    //Padding = new Thickness(0, 0, 0, 0)
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Orientation     = StackOrientation.Vertical
                };
                listView.MinimumHeightRequest = listView.Height;
                listView.BackgroundColor      = Color.Transparent;
                #endregion

                #region contents, button
                slForOnsiteInformation = new StackLayout
                {
                    Children = { sOnsiteInformation, slblAddNewOnsiteInfo,         sOnsiteWorkedCompany,
                                 sSeparator7,        sOnsiteWorkedCompanyLocation,
                                 sSeparator8,        sOnsiteWorkedCompanyDuration,
                                 sSeparator9,        sOnsiteWorkedCompanyDetail,   sSeparator10,        sOnsiteWorkedCompanyReferenceContact,sSeparator11, sOnsiteWorkedCompanyPhoneNo, sSeparator12 },
                    IsVisible = false
                };

                Label AfterSaveResponse = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.Green
                };
                StackLayout slAfterSaveResponse = new StackLayout
                {
                    Children    = { AfterSaveResponse },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };

                Button btnSaveData = new Button {
                    Text = "SAVE", HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.FromHex("f7cc59"), TextColor = Color.Black, BorderRadius = 50, WidthRequest = 270, FontAttributes = FontAttributes.Bold
                };
                StackLayout sbtnSaveData = new StackLayout
                {
                    Children    = { btnSaveData },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 10, 0, 8)
                };

                #region stack layout for adding all work experience info
                slAddAllExperienceInformation = new StackLayout
                {
                    Children = { slblAddNewWorkExp, sCompanyName, sSeparator1, sWorkDesignation, sSeparator2, sWorkRole, sSeparator3, sWorkDuration, sSeparator4, sWorkReferenceContact, sSeparator5, sWorkPhoneNo, sSeparator6, sSwithForOnsite }
                };
                slAddAllExperienceInformation.IsVisible = false;
                sbtnSaveData.IsVisible    = false;
                btnAddNewWorkExp.Clicked += (object sender, EventArgs e) =>
                {
                    slAddAllExperienceInformation.IsVisible = true;
                    sbtnSaveData.IsVisible = true;
                };
                #endregion

                StackLayout slWorkExperienceInfo = new StackLayout
                {
                    //Children = { sSwithForOnsite, sCompanyWorkExperience, sCompanyName, sWorkDesignation, sWorkRole, sWorkDuration, sWorkReferenceContact, sWorkPhoneNo, sOnsiteInformation, sOnsiteWorkedCompany, sOnsiteWorkedCompanyLocation, sOnsiteWorkedCompanyDuration, sOnsiteWorkedCompanyDetail, sOnsiteWorkedCompanyReferenceContact, slForOnsiteInformation, slAfterSaveResponse, sbtnSaveData },
                    Children          = { sBtnAddNewWorkExp, sCompanyWorkExperience, slHeaderText, sSeparatorListview, sListView, slAddAllExperienceInformation, slForOnsiteInformation, slAfterSaveResponse, sbtnSaveData },
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    Padding           = new Thickness(20, 0, 20, 0),
                    BackgroundColor   = Color.White
                };

                ScrollView svMyProfile = new ScrollView {
                    Content = slWorkExperienceInfo
                };

                Content = svMyProfile;
                #endregion

                #region post data to server side
                WorkExperienceModel workExperienceModel = new WorkExperienceModel();
                Onsite onsite = new Onsite();
                switchForOnsite1.Toggled += (object sender, ToggledEventArgs e) =>
                {
                    slForOnsiteInformation.IsVisible = true;
                    if (switchForOnsite1.IsToggled == false)
                    {
                        slForOnsiteInformation.IsVisible = false;
                    }
                };
                btnSaveData.Clicked += (object sender, EventArgs e) =>
                {
                    if (Validate())
                    {
                        if (DateTime.Parse(lblFromDateText.Text) > DateTime.Parse(lblToDateText.Text))
                        {
                            DisplayAlert("Error", "Start date can not be greater than end date.", "OK");
                        }
                        else if (slForOnsiteInformation.IsVisible == true && (DateTime.Parse(lblFromDateOnsiteText.Text) > DateTime.Parse(lblToDateOnsiteText.Text)))
                        {
                            DisplayAlert("Error", "Start date can not be greater than end date for onsite.", "OK");
                        }
                        else
                        {
                            workExperienceModel.UserId           = ACTContext.userId;
                            workExperienceModel.Company          = CompanyName.Text;
                            workExperienceModel.Role             = workRole.Text;
                            workExperienceModel.Designation      = workDesignation.Text;
                            workExperienceModel.FromDate         = DateTime.Parse(lblFromDateText.Text);
                            workExperienceModel.ToDate           = DateTime.Parse(lblToDateText.Text);
                            workExperienceModel.ExperienceBrief  = companyWorkExperience.Text;
                            workExperienceModel.ReferenceContact = workReferenceContact.Text;
                            workExperienceModel.ExperoenceYear   = 5;

                            slHeaderText.IsVisible       = true;
                            sSeparatorListview.IsVisible = true;

                            onsite.OnsiteDetails = onsiteWorkedCompanyDetail.Text;
                            if (slForOnsiteInformation.IsVisible == true)
                            {
                                onsite.StartDate = DateTime.Parse(lblFromDateOnsiteText.Text);
                                onsite.EndDate   = DateTime.Parse(lblToDateOnsiteText.Text);
                            }
                            if (slForOnsiteInformation.IsVisible == false)
                            {
                                onsite.StartDate = DateTime.Now;
                                onsite.EndDate   = DateTime.Now;
                            }
                            if (slForOnsiteInformation.IsVisible == true)
                            {
                                onsite.ContactDetails = int.Parse(onsiteWorkedCompanyReferenceContact.Text);
                            }
                            if (slForOnsiteInformation.IsVisible == false)
                            {
                                onsite.ContactDetails = 0;
                            }
                            onsite.Location = onsiteWorkedCompanyLocation.Text;

                            if (slForOnsiteInformation.IsVisible == false)
                            {
                                workExperienceModel.onsite = null;
                            }
                            if (slForOnsiteInformation.IsVisible == true)
                            {
                                workExperienceModel.onsite = onsite;
                            }


                            Device.BeginInvokeOnMainThread(async() =>
                            {
                                var result                               = await Service.PostWorkExperience(workExperienceModel);
                                CompanyName.Text                         = string.Empty;
                                workDesignation.Text                     = string.Empty;
                                workRole.Text                            = string.Empty;
                                workReferenceContact.Text                = string.Empty;
                                workPhoneNo.Text                         = string.Empty;
                                onsiteWorkedCompany.Text                 = string.Empty;
                                onsiteWorkedCompanyLocation.Text         = string.Empty;
                                onsiteWorkedCompanyDetail.Text           = string.Empty;
                                onsiteWorkedCompanyDetail.Text           = string.Empty;
                                onsiteWorkedCompanyPhoneNo.Text          = string.Empty;
                                onsiteWorkedCompanyReferenceContact.Text = string.Empty;



                                AfterSaveResponse.Text = "Data saved successfully";

                                var resultUpdated = await Service.GetWorkExpById(ACTContext.userId);         //63

                                var resultForOnsiteUpdated = await Service.GetOnsiteInfo(ACTContext.userId); //63

                                if (resultUpdated != null)
                                {
                                    workExperienceList = (List <WorkExperienceModel>)JsonConvert.DeserializeObject <List <WorkExperienceModel> >(resultUpdated);
                                }
                                workExperienceObservableCollection = workExperienceList;
                                listView.HeightRequest             = 50 * workExperienceList.Count;
                                listView.ItemsSource  = workExperienceObservableCollection;
                                listView.ItemTemplate = new DataTemplate(() => new WorkExperienceCell(workExperienceObservableCollection));
                            });
                        }
                    }
                    ;
                };
                #endregion
            }
            else
            {
                Navigation.PushModalAsync(new Login());
            }
        }
Пример #5
0
        public void InterviewMatrixLayout(List <Models.CandidateDetails> candidateListForIm)
        {
            if (ACTContext.isLogin == true)
            {
                #region header text
                Label lblInterviewMatrixInfo = new Label {
                    Text = "Interview Matrix", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex("5e247f"), FontSize = 18, FontAttributes = FontAttributes.Bold, HeightRequest = 30
                };
                Label interviewMatrixInfo = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, HeightRequest = 40
                };
                StackLayout sInterviewMatrixInfo = new StackLayout
                {
                    Children    = { lblInterviewMatrixInfo, interviewMatrixInfo },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 50, 0, 0)
                };
                #endregion

                #region candidate name
                Label lblCandidatePickerTitle = new Label {
                    Text = "Candidate Name", TextColor = Color.Gray
                };
                pkrCandidateName = new Picker {
                    IsVisible = false
                };
                pkrCandidateName.Title = "Candidate Name";
                foreach (CandidateDetails item in candidateListForIm)
                {
                    pkrCandidateName.Items.Add(item.CandidateName.ToString());
                }
                pkrCandidateName.SelectedIndexChanged += (s, e) =>
                {
                    lblCandidatePickerTitle.TextColor = Color.Black;
                    lblCandidatePickerTitle.Text      = pkrCandidateName.Items[pkrCandidateName.SelectedIndex].ToString();
                };
                Image imgPkrCandidateNameDropdown = new Image {
                    Source = "dropdownPicker.png", HorizontalOptions = LayoutOptions.EndAndExpand
                };

                StackLayout sPkrCandidateName = new StackLayout {
                    Children = { lblCandidatePickerTitle, pkrCandidateName, imgPkrCandidateNameDropdown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(0, 5, 0, 5)
                };
                Frame frmPkrCandidateName = new Frame {
                    Content = sPkrCandidateName, BackgroundColor = Color.White, Padding = new Thickness(Device.OnPlatform(8, 5, 0)), HasShadow = false
                };

                recognizerCandidateName.NumberOfTapsRequired = 1;
                recognizerCandidateName.Tapped += (s, e) =>
                {
                    pkrCandidateName.Focus();
                };
                frmPkrCandidateName.GestureRecognizers.Add(recognizerCandidateName);
                Seperator candidateNameSeparator = new Seperator();


                Button btnSubmitCandidate = new Button {
                    Text = "Submit", HorizontalOptions = LayoutOptions.StartAndExpand, BackgroundColor = Color.FromHex("4690FB"), TextColor = Color.White, BorderRadius = 10, WidthRequest = 80, FontAttributes = FontAttributes.None, HeightRequest = 40
                };
                StackLayout sBtnSubmitCandidate = new StackLayout
                {
                    Children    = { btnSubmitCandidate },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 5, 0, 5)
                };

                #endregion

                #region candidate information

                #region first name
                //First Name
                Label lblCandidateFirstName = new Label {
                    Text = "First name : ", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, WidthRequest = 90
                };
                Label lblCandidateFirstNameText = new Label {
                    Text = "demo demo demo", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black
                };
                StackLayout slblCandidateFirstName = new StackLayout
                {
                    Children          = { lblCandidateFirstName, lblCandidateFirstNameText },
                    Orientation       = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.StartAndExpand,
                    Margin            = new Thickness(0, 10, 0, 10)
                };
                Seperator separatorFirstName = new Seperator();
                #endregion

                #region last name
                //Last Name
                Label lblCandidateLastName = new Label {
                    Text = "Last name : ", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, WidthRequest = 90
                };
                Label lblCandidateLastNameText = new Label {
                    Text = "demo demo", HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.Black
                };
                StackLayout slblCandidateLastName = new StackLayout
                {
                    Children          = { lblCandidateLastName, lblCandidateLastNameText },
                    Orientation       = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.StartAndExpand,
                    Margin            = new Thickness(0, 10, 0, 10)
                };
                Seperator separatorLastName = new Seperator();
                #endregion

                #region address
                //Address
                Label lblCandidateAddress = new Label {
                    Text = "Address : ", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, WidthRequest = 90
                };
                Label lblCandidateAddressText = new Label {
                    Text = "demo address", HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.Black
                };
                StackLayout slblCandidateAddress = new StackLayout
                {
                    Children          = { lblCandidateAddress, lblCandidateAddressText },
                    Orientation       = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.StartAndExpand,
                    Margin            = new Thickness(0, 10, 0, 10)
                };
                Seperator separatorAddress = new Seperator();
                #endregion

                #region educational qualification
                //Educational qualification
                Label lblCandidateEducationalQualification = new Label {
                    Text = "Educational Qualification : ", HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black, WidthRequest = 90
                };
                Label lblCandidateEducationalQualificationText = new Label {
                    Text = "demo qualification", HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.Black
                };
                StackLayout slblCandidateEducationalQualification = new StackLayout
                {
                    Children          = { lblCandidateEducationalQualification, lblCandidateEducationalQualificationText },
                    Orientation       = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.StartAndExpand,
                    Margin            = new Thickness(0, 10, 0, 10)
                };
                Seperator separatorEducationalQualification = new Seperator();
                #endregion

                #region candidate information stack layout
                slCandidateInformation = new StackLayout
                {
                    Children = { slblCandidateFirstName,                separatorFirstName,
                                 slblCandidateLastName,                 separatorLastName,
                                 slblCandidateAddress,                  separatorAddress,
                                 slblCandidateEducationalQualification, separatorEducationalQualification }
                };
                slCandidateInformation.IsVisible = false;
                #endregion

                #region submit button click
                btnSubmitCandidate.Clicked += (object sender, EventArgs e) =>
                {
                    if (Validate())
                    {
                        slCandidateInformation.IsVisible = true;

                        sListView.IsVisible    = true;
                        slHeaderText.IsVisible = true;
                        sSeparatorListviewInterviewRounds.IsVisible = true;

                        slHeaderTextForLineItem.IsVisible = true;
                        sListViewLineItemDetail.IsVisible = true;
                        spForLineItemDetail.IsVisible     = true;

                        sOverallRemarkAdd.IsVisible  = true;
                        spOverallRemarkAdd.IsVisible = true;

                        sAverageRatingAdd.IsVisible  = true;
                        spAverageRatingAdd.IsVisible = true;

                        sSwithForCandidateSelected.IsVisible = true;

                        sSwithForCandidateMoveToNextRound.IsVisible = true;

                        slAfterSaveResponseAllInformation.IsVisible = true;
                        sbtnSaveAllInfo.IsVisible = true;

                        slineItemAdd.IsVisible  = true;
                        spLineItemAdd.IsVisible = true;

                        slAfterSaveResponseLineItem.IsVisible = true;

                        sbtnSaveDataLineItem.IsVisible = true;

                        int candidateId = (from c in candidateListForIm where c.CandidateName == pkrCandidateName.Items[pkrCandidateName.SelectedIndex] select c.CandidateId).SingleOrDefault();
                        Device.BeginInvokeOnMainThread(async() =>
                        {
                            //var result = await Service.GetCandidateInformation(interviewId2, ACTContext.interviewerId);
                            var result = await Service.GetCandidateDetailWithInterview(candidateId, 1);
                            var resultCandidateDetailListWithInterview = await Service.GetCandidateDetailWithInterview(candidateId, 1);
                            if (result != null)
                            {
                                interviewsModel            = JsonConvert.DeserializeObject <InterviewsModel>(result);
                                canditeDetailWithInterview = JsonConvert.DeserializeObject <InterviewsModel>(resultCandidateDetailListWithInterview);
                            }
                            lblCandidateFirstNameText.Text = interviewsModel.FirstName;
                            lblCandidateLastNameText.Text  = interviewsModel.LastName;
                            lblCandidateAddressText.Text   = interviewsModel.Address1;
                            lblCandidateEducationalQualificationText.Text = interviewsModel.QualificationName;

                            //for line item listview
                            List <InterviewsModel> interviewLineItemDetailObservableCollection = new List <InterviewsModel>();
                            interviewLineItemDetailObservableCollection = canditeDetailWithInterview.InterviewList;

                            List <Ratings> ratingListObservableCollection = new List <Ratings>();
                            foreach (var item in canditeDetailWithInterview.InterviewList)
                            {
                                for (int i = 0; i < item.RatingList.Count; i++)
                                {
                                    ratingListObservableCollection.Add(item.RatingList[i]);
                                }
                            }

                            listViewLineItemDetail.HeightRequest = 50 * ratingListObservableCollection.Count;
                            listViewLineItemDetail.ItemsSource   = ratingListObservableCollection;
                            listViewLineItemDetail.ItemTemplate  = new DataTemplate(() => new LineItemDetailCell(interviewLineItemDetailObservableCollection, ratingListObservableCollection));


                            //for overall listview
                            List <InterviewsModel> interviewRoundDetailObservableCollection = new List <InterviewsModel>();
                            interviewRoundDetailObservableCollection = canditeDetailWithInterview.InterviewList;



                            listView.HeightRequest = 50 * interviewRoundDetailObservableCollection.Count;

                            listView.ItemsSource  = interviewRoundDetailObservableCollection;
                            listView.ItemTemplate = new DataTemplate(() => new InterviewMatrixCell(interviewRoundDetailObservableCollection, candidateListForIm, canditeDetailWithInterview));
                        });
                    }
                };
                #endregion

                #endregion

                #region listView
                sListView = new StackLayout
                {
                    Children    = { listView },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                sListView.IsVisible = false;
                #endregion

                #region interview round detail
                slHeaderText = new StackLayout();
                Label lblCandidateName = new Label {
                    Text = "Name", FontAttributes = FontAttributes.Bold, WidthRequest = 50, HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.FromHex("5e247f")
                };
                Label lblRound = new Label {
                    Text = "Round", FontAttributes = FontAttributes.Bold, WidthRequest = 50, HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.FromHex("5e247f")
                };
                Label lblRemark = new Label {
                    Text = "Remark", FontAttributes = FontAttributes.Bold, WidthRequest = 50, HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.FromHex("5e247f")
                };
                //Label lblAverageRating = new Label { Text = "Average Rating", FontAttributes = FontAttributes.Bold, WidthRequest = 80, HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex("5e247f") };
                //Label lblSelected = new Label { Text = "Selected", FontAttributes = FontAttributes.Bold, WidthRequest = 80, HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex("5e247f") };
                slHeaderText = new StackLayout
                {
                    Children    = { lblCandidateName, lblRound, lblRemark },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                slHeaderText.IsVisible = false;

                StackLayout slCandidateInterviewInfo = new StackLayout
                {
                    Children    = { sListView },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separatorListviewInterviewRounds = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                sSeparatorListviewInterviewRounds = new StackLayout
                {
                    Children    = { separatorListviewInterviewRounds },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                sSeparatorListviewInterviewRounds.IsVisible = false;
                #endregion

                #region separator
                BoxView separator1 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator1 = new StackLayout
                {
                    Children    = { separator1 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator2 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator2 = new StackLayout
                {
                    Children    = { separator2 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator3 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator3 = new StackLayout
                {
                    Children    = { separator3 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                BoxView separator4 = new BoxView()
                {
                    Color = Color.Gray, HeightRequest = 1, HorizontalOptions = LayoutOptions.FillAndExpand
                };
                StackLayout sSeparator4 = new StackLayout
                {
                    Children    = { separator4 },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                #endregion

                #region listViewFor LineItem rating and remark


                Label lblRoundLineItem = new Label {
                    Text = "Round", FontAttributes = FontAttributes.Bold, WidthRequest = 50, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f"), HeightRequest = 30
                };
                Label lblLineItemName = new Label {
                    Text = "Parameter", FontAttributes = FontAttributes.Bold, WidthRequest = 70, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f"), HeightRequest = 30
                };
                Label lblRatingLineItem = new Label {
                    Text = "Rating", FontAttributes = FontAttributes.Bold, WidthRequest = 50, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f"), HeightRequest = 30
                };
                Label lblRemarkLineItem = new Label {
                    Text = "Remark", FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.Start, TextColor = Color.FromHex("5e247f"), HeightRequest = 30
                };
                Label lblSelectedLineItem = new Label {
                    Text = "Selected", FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.End, TextColor = Color.FromHex("5e247f"), HeightRequest = 30
                };
                slHeaderTextForLineItem = new StackLayout
                {
                    Children        = { lblRoundLineItem, lblLineItemName, lblRatingLineItem, lblRemarkLineItem, lblSelectedLineItem },
                    Orientation     = StackOrientation.Horizontal,
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                    Padding         = new Thickness(0, 20, 0, 0)
                };
                slHeaderTextForLineItem.IsVisible = false;

                spForLineItemDetail.IsVisible = false;
                sListViewLineItemDetail       = new StackLayout
                {
                    Children    = { listViewLineItemDetail },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                sListViewLineItemDetail.IsVisible = false;
                #endregion

                #region overall remark
                overallRemarkAdd = new CustomEntryForGeneralPurpose {
                    Placeholder = "Add overall remark here", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                sOverallRemarkAdd = new StackLayout
                {
                    Children    = { overallRemarkAdd },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                sOverallRemarkAdd.IsVisible  = false;
                spOverallRemarkAdd.IsVisible = false;
                #endregion

                #region average rating
                averageRatingAdd = new CustomEntryForGeneralPurpose {
                    Placeholder = "Add average rating here", HorizontalOptions = LayoutOptions.FillAndExpand, Keyboard = Keyboard.Numeric
                };
                averageRatingAdd.Behaviors.Add(new DecimalNumberValidationBehaviour());
                sAverageRatingAdd = new StackLayout
                {
                    Children    = { averageRatingAdd },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                sAverageRatingAdd.IsVisible  = false;
                spAverageRatingAdd.IsVisible = false;
                #endregion

                #region seleted or not
                Label lblCandidateSelected = new Label {
                    Text = "Selected", HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.Black, WidthRequest = 80
                };
                Switch switchForLblCandidateSelected = new Switch {
                    MinimumWidthRequest = 50, HorizontalOptions = LayoutOptions.StartAndExpand, BackgroundColor = Color.Transparent
                };
                sSwithForCandidateSelected = new StackLayout
                {
                    Children    = { lblCandidateSelected, switchForLblCandidateSelected },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 10, 0, 0)
                };
                sSwithForCandidateSelected.IsVisible = false;
                #endregion

                #region move to next round
                Label lblCandidateMoveToNextRound = new Label {
                    Text = "Move to next round", HorizontalOptions = LayoutOptions.StartAndExpand, TextColor = Color.Black, WidthRequest = 80
                };
                Switch switchForLblCandidateMoveToNextRound = new Switch {
                    MinimumWidthRequest = 50, HorizontalOptions = LayoutOptions.StartAndExpand, BackgroundColor = Color.Transparent
                };
                sSwithForCandidateMoveToNextRound = new StackLayout
                {
                    Children    = { lblCandidateMoveToNextRound, switchForLblCandidateMoveToNextRound },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 10)
                };
                sSwithForCandidateMoveToNextRound.IsVisible = false;
                #endregion

                #region save button for saving all information
                Label AfterSaveResponseAllInformation = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.Green
                };
                slAfterSaveResponseAllInformation = new StackLayout
                {
                    Children    = { AfterSaveResponseAllInformation },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };
                slAfterSaveResponseAllInformation.IsVisible = false;

                Button btnSaveAllInfo = new Button {
                    Text = "Save", HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.FromHex("f7cc59"), TextColor = Color.Black, BorderRadius = 50, WidthRequest = 200, FontAttributes = FontAttributes.Bold
                };
                sbtnSaveAllInfo = new StackLayout
                {
                    Children    = { btnSaveAllInfo },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 10, 0, 8)
                };
                sbtnSaveAllInfo.IsVisible = false;



                #endregion

                #region post data
                btnSaveAllInfo.Clicked += (object sender, EventArgs e) =>
                {
                    if (ValidateForAllDataSave())
                    {
                        interviewsModel.IRRemarks        = overallRemarkAdd.Text;
                        interviewsModel.IRCombinedRating = decimal.Parse(averageRatingAdd.Text);
                        if (switchForLblCandidateSelected.IsToggled == true)
                        {
                            interviewsModel.IRSelected = 1;
                        }
                        if (switchForLblCandidateSelected.IsToggled == false)
                        {
                            interviewsModel.IRSelected = 0;
                        }
                        if (switchForLblCandidateMoveToNextRound.IsToggled == true)
                        {
                            interviewsModel.IRMovedToNextRound = 1;
                        }
                        if (switchForLblCandidateMoveToNextRound.IsToggled == false)
                        {
                            interviewsModel.IRMovedToNextRound = 0;
                        }
                        Device.BeginInvokeOnMainThread(async() =>
                        {
                            var result = await Service.SaveInterviewRound(interviewsModel);
                            AfterSaveResponseAllInformation.Text = "Data saved";
                        });
                        lineItemAdd.Text = string.Empty;
                    }
                };
                #endregion

                #region line item save
                lineItemAdd = new CustomEntryForGeneralPurpose {
                    Placeholder = "Add new line item here", HorizontalOptions = LayoutOptions.FillAndExpand
                };
                slineItemAdd = new StackLayout
                {
                    Children    = { lineItemAdd },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 0, 0, 0)
                };
                slineItemAdd.IsVisible  = false;
                spLineItemAdd.IsVisible = false;

                Label AfterSaveResponseLineItem = new Label {
                    Text = "", HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.Green
                };
                slAfterSaveResponseLineItem = new StackLayout
                {
                    Children    = { AfterSaveResponseLineItem },
                    Orientation = StackOrientation.Horizontal,
                    Margin      = new Thickness(0, 8, 0, 0)
                };
                slAfterSaveResponseLineItem.IsVisible = false;

                Button btnSaveDataLineItem = new Button {
                    Text = "Add Line Item", HorizontalOptions = LayoutOptions.CenterAndExpand, BackgroundColor = Color.FromHex("f7cc59"), TextColor = Color.Black, BorderRadius = 50, WidthRequest = 200, FontAttributes = FontAttributes.Bold
                };
                sbtnSaveDataLineItem = new StackLayout
                {
                    Children    = { btnSaveDataLineItem },
                    Orientation = StackOrientation.Horizontal,
                    Padding     = new Thickness(0, 10, 0, 8)
                };
                sbtnSaveDataLineItem.IsVisible = false;
                LineItem lineItems = new LineItem();

                btnSaveDataLineItem.Clicked += (object sender, EventArgs e) =>
                {
                    if (ValidateForLineItem())
                    {
                        lineItems.LineItemDescription = lineItemAdd.Text;
                        Device.BeginInvokeOnMainThread(async() =>
                        {
                            var result = await Service.PostLineItem(lineItems);
                            AfterSaveResponseLineItem.Text = "Line item saved";
                        });
                        lineItemAdd.Text = string.Empty;
                    }
                };
                #endregion

                #region contents and stack layouts

                StackLayout slInterviewMatrixInformation = new StackLayout
                {
                    Children = { sInterviewMatrixInfo,

                                 frmPkrCandidateName,              candidateNameSeparator,
                                 sBtnSubmitCandidate,
                                 slCandidateInformation,

                                 sInterviewRoundEdit,              slCandidateEditInfo,
                                 slHeaderTextForLineItem,          spForLineItemDetail,               sListViewLineItemDetail,
                                 slHeaderText,                     sSeparatorListviewInterviewRounds, slCandidateInterviewInfo,
                                 sOverallRemarkAdd,                spOverallRemarkAdd,                sAverageRatingAdd,           spAverageRatingAdd,sSwithForCandidateSelected, sSwithForCandidateMoveToNextRound,
                                 slAfterSaveResponseAllInformation,sbtnSaveAllInfo,
                                 slineItemAdd,                     spLineItemAdd,                     slAfterSaveResponseLineItem, sbtnSaveDataLineItem },
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    Padding           = new Thickness(20, 0, 20, 0),
                    BackgroundColor   = Color.White
                };

                ScrollView svInterviewMatrixDetails = new ScrollView {
                    Content = slInterviewMatrixInformation
                };

                Content = svInterviewMatrixDetails;

                #endregion
            }
            else
            {
                Navigation.PushModalAsync(new Login());
            }
        }