/// <summary> /// Initializes a new instance of the <see cref="Enter Student Mark Page"/> class. /// </summary> public EnterStudentMark() { IsLoading = true; Device.BeginInvokeOnMainThread(async() => { try { _StandardList = await StandardModel.GetStandard(); EnterStudentMarkLayout(); } catch (Exception ex) { } }); }
/// <summary> /// Initializes a new instance of the <see cref="Upload Sample Paper Page"/> class. /// </summary> public UploadSamplePaper() { IsLoading = true; Device.BeginInvokeOnMainThread(async() => { try { _StandardList = await StandardModel.GetStandard(); UploadSamplePaperLayout(); } catch (Exception ex) { } }); }
/// <summary> /// Initializes a new instance of the <see cref="Student BehaviourNotice Page"/> class. /// </summary> public StudentBehaviourNotice() { IsLoading = true; Device.BeginInvokeOnMainThread(async() => { try { IsLoading = true; _StandardList = await StandardModel.GetStandard(); StudentBehaviourLayout(); } catch (Exception ex) { } }); }
/// <summary> /// Initializes a new instance of the <see cref="FillUpAttendance"/> class. /// </summary> public FillUpAttendance() { IsLoading = true; Device.BeginInvokeOnMainThread(async() => { try { IsLoading = true; _StandardList = await StandardModel.GetStandard(); FillUpAttendanceLayout(); } catch (Exception ex) { } }); }
/// <summary> /// Todays Timetable /// </summary> public void TodaysTimetableLayout() { try { TitleBar lblPageName = new TitleBar("Today's TimeTable"); StackLayout slTitle = new StackLayout { Orientation = StackOrientation.Horizontal, Padding = new Thickness(0, 5, 0, 0), BackgroundColor = Color.White, Children = { lblPageName } }; Seperator spTitle = new Seperator(); BindableRadioGroup radByTeacherOrClass = new BindableRadioGroup(); radByTeacherOrClass.ItemsSource = new[] { "By Teacher", "By Class" }; radByTeacherOrClass.HorizontalOptions = LayoutOptions.FillAndExpand; radByTeacherOrClass.Orientation = StackOrientation.Horizontal; radByTeacherOrClass.TextColor = Color.Black; StackLayout slRadio = new StackLayout { Children = { radByTeacherOrClass }, HorizontalOptions = LayoutOptions.FillAndExpand }; #region By Teacher Image imgTeacherDropDown = new Image { Source = Constants.ImagePath.DropDownArrow, HorizontalOptions = LayoutOptions.EndAndExpand }; Label lblTeacher = new Label { TextColor = Color.Black, Text = "Teacher" }; Picker pcrTeacher = new Picker { IsVisible = false, Title = "Teacher" }; StackLayout slTeacherDisplay = new StackLayout { Children = { lblTeacher, pcrTeacher, imgTeacherDropDown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(Device.OnPlatform(0, 5, 0), Device.OnPlatform(0, 5, 0), Device.OnPlatform(0, 10, 0), Device.OnPlatform(0, 5, 0)) }; Frame frmTeacher = new Frame { Content = slTeacherDisplay, HorizontalOptions = LayoutOptions.FillAndExpand, OutlineColor = Color.Black, Padding = new Thickness(10) }; var teacherTap = new TapGestureRecognizer(); teacherTap.NumberOfTapsRequired = 1; // single-tap teacherTap.Tapped += (s, e) => { pcrTeacher.Focus(); }; frmTeacher.GestureRecognizers.Add(teacherTap); slTeacherDisplay.GestureRecognizers.Add(teacherTap); StackLayout slTeacherFrameLayout = new StackLayout { Children = { frmTeacher } }; StackLayout slTeacherLayout = new StackLayout { Children = { slTeacherFrameLayout }, Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = false }; Label lblStandardName = new Label { Text = "Standard Name", TextColor = Color.Black }; StackLayout slStandardName = new StackLayout { Children = { lblStandardName }, VerticalOptions = LayoutOptions.CenterAndExpand, }; Label lblClassTypeName = new Label { Text = "Class Type Name", TextColor = Color.Black }; StackLayout slClassTypeName = new StackLayout { Children = { lblClassTypeName }, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand }; Label lblStubjectName = new Label { Text = "Subject Name", TextColor = Color.Black }; StackLayout slSubjectName = new StackLayout { Children = { lblStubjectName }, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.EndAndExpand }; #endregion #region By Class Image imgStandardDropDown = new Image { Source = Constants.ImagePath.DropDownArrow, HorizontalOptions = LayoutOptions.EndAndExpand }; Label lblStandard = new Label { TextColor = Color.Black, Text = "Standard" }; Picker pcrStandard = new Picker { IsVisible = false, Title = "Standard" }; StackLayout slStandardDisplay = new StackLayout { Children = { lblStandard, pcrStandard, imgStandardDropDown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(Device.OnPlatform(0, 5, 0), Device.OnPlatform(0, 5, 0), Device.OnPlatform(0, 10, 0), Device.OnPlatform(0, 5, 0)) }; Frame frmStandard = new Frame { Content = slStandardDisplay, HorizontalOptions = LayoutOptions.FillAndExpand, OutlineColor = Color.Black, Padding = new Thickness(10) }; var standardTap = new TapGestureRecognizer(); standardTap.NumberOfTapsRequired = 1; // single-tap standardTap.Tapped += (s, e) => { pcrStandard.Focus(); }; frmStandard.GestureRecognizers.Add(standardTap); slStandardDisplay.GestureRecognizers.Add(standardTap); StackLayout slStandardFrameLayout = new StackLayout { Children = { frmStandard } }; StackLayout slStandardLayout = new StackLayout { Children = { slStandardFrameLayout }, Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand, }; Image imgClassDropDown = new Image { Source = Constants.ImagePath.DropDownArrow, HorizontalOptions = LayoutOptions.EndAndExpand }; Label lblClass = new Label { TextColor = Color.Black, Text = "Class" }; Picker pcrClass = new Picker { IsVisible = false, Title = "Class" }; StackLayout slClassDisplay = new StackLayout { Children = { lblClass, pcrClass, imgClassDropDown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(Device.OnPlatform(0, 5, 0), Device.OnPlatform(0, 5, 0), Device.OnPlatform(0, 10, 0), Device.OnPlatform(0, 5, 0)) }; Frame frmClass = new Frame { Content = slClassDisplay, HorizontalOptions = LayoutOptions.FillAndExpand, OutlineColor = Color.Black, Padding = new Thickness(10) }; var classTap = new TapGestureRecognizer(); classTap.NumberOfTapsRequired = 1; // single-tap classTap.Tapped += (s, e) => { pcrClass.Focus(); }; frmClass.GestureRecognizers.Add(classTap); slClassDisplay.GestureRecognizers.Add(classTap); StackLayout slClassFrameLayout = new StackLayout { Children = { frmClass } }; StackLayout slClassLayout = new StackLayout { Children = { slClassFrameLayout }, Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = false }; //Grid Header Label lblTeachername = new Label { Text = "Teacher Name", TextColor = Color.Black }; StackLayout slTeacherName = new StackLayout { Children = { lblTeachername }, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand }; Label lblStubject = new Label { Text = "Subject Name", TextColor = Color.Black }; StackLayout slSubject = new StackLayout { Children = { lblStubject }, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.EndAndExpand }; #endregion Label lblSequensNo = new Label { Text = "No", TextColor = Color.Black }; StackLayout slSequensNo = new StackLayout { Children = { lblSequensNo }, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.StartAndExpand }; StackLayout grid = new StackLayout { //Children = { slTeacherName, slSequensNo, slSubjectName }, Orientation = StackOrientation.Horizontal, IsVisible = false }; Seperator spDisplayHeader = new Seperator { IsVisible = false }; StackLayout slSearchinOneCol = new StackLayout { Children = { slStandardLayout, slClassLayout }, Orientation = StackOrientation.Horizontal, IsVisible = false }; _NotAvailData = new Label { Text = "No data availalble for this search data.", TextColor = Color.Red, IsVisible = false }; _Loader = new LoadingIndicator(); radByTeacherOrClass.CheckedChanged += (sender, e) => { Device.BeginInvokeOnMainThread(async () => { var radio = sender as CustomRadioButton; if (radio == null || radio.Id == -1) { return; } if (radio.Text == "By Teacher") { slTeacherLayout.IsVisible = true; slSearchinOneCol.IsVisible = false; foreach (TeacherModel item in _TeacherList) { pcrTeacher.Items.Add(item.Name); } grid.Children.Add(slSequensNo); grid.Children.Add(slStandardDisplay); grid.Children.Add(slClassTypeName); grid.Children.Add(slSubjectName); } else { slSearchinOneCol.IsVisible = true; slTeacherLayout.IsVisible = false; grid.Children.Add(slSequensNo); grid.Children.Add(slTeacherName); grid.Children.Add(slSubject); _StatndardList = await StandardModel.GetStandard(); foreach (StandardModel item in _StatndardList) { pcrStandard.Items.Add(item.Name); } } }); }; //List view ListView TimeTableListView = new ListView { RowHeight = 50, SeparatorColor = Color.Gray }; TimeTableListView.ItemTemplate = new DataTemplate(() => new FillUpAttendanceCell()); pcrStandard.SelectedIndexChanged += (sender, e) => { Device.BeginInvokeOnMainThread(async () => { try { _Loader.IsShowLoading = true; pcrClass.Items.Clear(); string standardName = lblStandard.Text = pcrStandard.Items[pcrStandard.SelectedIndex]; _SelectedStandardID = _StatndardList.Where(x => x.Name == standardName).FirstOrDefault().Id; _ClassTypeList = await ClassTypeModel.GetClassType(_SelectedStandardID); if (_ClassTypeList.Count > 0 && _ClassTypeList != null) { slClassLayout.IsVisible = true; _NotAvailData.IsVisible = false; } else { slClassLayout.IsVisible = false; _NotAvailData.IsVisible = true; } foreach (ClassTypeModel item in _ClassTypeList) { pcrClass.Items.Add(item.Name); } _Loader.IsShowLoading = false; } catch (Exception ex) { } }); }; //Class Picker Selected pcrClass.SelectedIndexChanged += (sender, e) => { Device.BeginInvokeOnMainThread(async () => { _Loader.IsShowLoading = true; _NotAvailData.IsVisible = false; string className = lblClass.Text = pcrClass.Items[pcrClass.SelectedIndex]; _SelectedClassTypeID = _ClassTypeList.FirstOrDefault(x => x.Name == className).Id; //Get time table list _TimeTableList = await TimeTableModel.ShowTimeTable(_SelectedStandardID, _SelectedClassTypeID); if (_TimeTableList != null && _TimeTableList.Count > 0) { grid.IsVisible = true; spDisplayHeader.IsVisible = true; Items = new ObservableCollection<TimeTableModel>(_TimeTableList); TimeTableListView.ItemsSource = Items; } else { grid.IsVisible = false; spDisplayHeader.IsVisible = false; _NotAvailData.Text = "There is no data for selected standard and class."; _NotAvailData.IsVisible = true; } _Loader.IsShowLoading = false; }); }; //Class Picker Selected pcrTeacher.SelectedIndexChanged += (sender, e) => { Device.BeginInvokeOnMainThread(async () => { _Loader.IsShowLoading = true; _NotAvailData.IsVisible = false; string teacherName = lblTeacher.Text = pcrTeacher.Items[pcrTeacher.SelectedIndex]; _SelectedTeacherID = _TeacherList.FirstOrDefault(x => x.Name == teacherName).ID; //Get time table list _TimeTableList = await TimeTableModel.ShowTimeTable(_SelectedTeacherID); if (_TimeTableList != null && _TimeTableList.Count > 0) { grid.IsVisible = true; spDisplayHeader.IsVisible = true; Items = new ObservableCollection<TimeTableModel>(_TimeTableList); TimeTableListView.ItemsSource = Items; } else { grid.IsVisible = false; spDisplayHeader.IsVisible = false; _NotAvailData.Text = "There is no data for selected standard and class."; _NotAvailData.IsVisible = true; } _Loader.IsShowLoading = false; }); }; StackLayout slTimeTable = new StackLayout { Children = { new StackLayout{ Padding = new Thickness(20, Device.OnPlatform(40,20,0), 20, 20), Children = {slTitle, spTitle.LineSeperatorView,slRadio,slTeacherLayout, slSearchinOneCol,grid,spDisplayHeader.LineSeperatorView, _Loader, _NotAvailData,TimeTableListView}, VerticalOptions = LayoutOptions.FillAndExpand, }, }, BackgroundColor = LayoutHelper.PageBackgroundColor }; Content = new ScrollView { Content = slTimeTable, }; } catch (Exception ex) { throw; } }
/// <summary> /// HeadCount Layout /// </summary> public void HeadCountLayout() { try { TitleBar lblPageName = new TitleBar("Head Count"); StackLayout slTitle = new StackLayout { Orientation = StackOrientation.Horizontal, Padding = new Thickness(0, 5, 0, 0), BackgroundColor = Color.White, Children = { lblPageName } }; Seperator spTitle = new Seperator(); Image imgTypeDropDown = new Image { Source = Constants.ImagePath.DropDownArrow, HorizontalOptions = LayoutOptions.EndAndExpand }; Label lblType = new Label { TextColor = Color.Black }; lblType.Text = "Employee"; Picker pcrType = new Picker { IsVisible = false }; StackLayout slTypeDisplay = new StackLayout { Children = { lblType, pcrType, imgTypeDropDown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(Device.OnPlatform(0, 5, 0), Device.OnPlatform(0, 5, 0), Device.OnPlatform(0, 10, 0), Device.OnPlatform(0, 5, 0)) }; //Frame layout for start date Frame frmType = new Frame { Content = slTypeDisplay, HorizontalOptions = LayoutOptions.FillAndExpand, OutlineColor = Color.Black, Padding = new Thickness(10) }; var typeTap = new TapGestureRecognizer(); typeTap.NumberOfTapsRequired = 1; // single-tap typeTap.Tapped += (s, e) => { pcrType.Focus(); }; frmType.GestureRecognizers.Add(typeTap); slTypeDisplay.GestureRecognizers.Add(typeTap); StackLayout slTypeFrmaeLayout = new StackLayout { Children = { frmType } }; StackLayout slTypeLayout = new StackLayout { Children = { slTypeFrmaeLayout }, Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand }; pcrType.Items.Add("Student"); pcrType.Items.Add("Employee"); Image imgStandardDropDown = new Image { Source = Constants.ImagePath.DropDownArrow, HorizontalOptions = LayoutOptions.EndAndExpand }; Label lblStandard = new Label { TextColor = Color.Black, Text = "Standard" }; Picker pcrStandard = new Picker { IsVisible = false, Title = "Standard" }; foreach (StandardModel item in _StandardList) { pcrStandard.Items.Add(item.Name); } StackLayout slStandardDisplay = new StackLayout { Children = { lblStandard, pcrStandard, imgStandardDropDown }, Orientation = StackOrientation.Horizontal, Padding = new Thickness(Device.OnPlatform(0, 5, 0), Device.OnPlatform(0, 5, 0), Device.OnPlatform(0, 10, 0), Device.OnPlatform(0, 5, 0)) }; Frame frmStandard = new Frame { Content = slStandardDisplay, HorizontalOptions = LayoutOptions.FillAndExpand, OutlineColor = Color.Black, Padding = new Thickness(10) }; var standardTap = new TapGestureRecognizer(); standardTap.NumberOfTapsRequired = 1; // single-tap standardTap.Tapped += (s, e) => { pcrStandard.Focus(); }; frmStandard.GestureRecognizers.Add(standardTap); slStandardDisplay.GestureRecognizers.Add(standardTap); StackLayout slStandardFrameLayout = new StackLayout { Children = { frmStandard } }; StackLayout slStandardLayout = new StackLayout { Children = { slStandardFrameLayout }, Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = false }; #region Teacher Label lblTotal = new Label { Text = "Total", TextColor = Color.Black }; Label lblTotalValue = new Label { TextColor = Color.Black }; Label lblTotalMale = new Label { Text = "Total Male", TextColor = Color.Black }; Label lblTotalMaleValue = new Label { TextColor = Color.Black }; Label lblTotalFeMale = new Label { Text = "Total FeMale", TextColor = Color.Black }; Label lblTotalFeMalValue = new Label { TextColor = Color.Black }; StackLayout slTotal = new StackLayout { Orientation = StackOrientation.Vertical, Children = { lblTotal, lblTotalValue }, HorizontalOptions = LayoutOptions.StartAndExpand }; StackLayout slTotalMale = new StackLayout { Orientation = StackOrientation.Vertical, Children = { lblTotalMale, lblTotalMaleValue }, HorizontalOptions = LayoutOptions.CenterAndExpand }; StackLayout slTotalFeMale = new StackLayout { Orientation = StackOrientation.Vertical, Children = { lblTotalFeMale, lblTotalFeMalValue }, HorizontalOptions = LayoutOptions.EndAndExpand }; StackLayout slEmployee = new StackLayout { Children = { slTotal, slTotalMale, slTotalFeMale }, Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, IsVisible = false }; if (!string.IsNullOrEmpty(Convert.ToString(_EmployeeModel.Total)) && !string.IsNullOrEmpty(Convert.ToString(_EmployeeModel.TotalMale)) && !string.IsNullOrEmpty(Convert.ToString(_EmployeeModel.TotalFemale))) { lblTotalValue.Text = Convert.ToString(_EmployeeModel.Total); lblTotalMaleValue.Text = Convert.ToString(_EmployeeModel.TotalMale); lblTotalFeMalValue.Text = Convert.ToString(_EmployeeModel.TotalFemale); slEmployee.IsVisible = true; } else { _NotAvailData.IsVisible = false; } #endregion #region Student ListView studentHeadCountListView = new ListView(); studentHeadCountListView.HasUnevenRows = true; studentHeadCountListView.SeparatorColor = Color.Gray; studentHeadCountListView.ItemTemplate = new DataTemplate(() => new StudentHeadCountCell()); #endregion pcrType.SelectedIndexChanged += async(sender, e) => { try { using (UserDialogs.Instance.Loading("Loading")) { string type = lblType.Text = pcrType.Items[pcrType.SelectedIndex]; if (type == "Student") { slStandardLayout.IsVisible = true; slEmployee.IsVisible = false; _NotAvailData.IsVisible = false; _StandardList = await StandardModel.GetStandard(); if (_StandardList != null && _StandardList.Count > 0) { foreach (StandardModel item in _StandardList) { pcrStandard.Items.Add(item.Name); } } else { _NotAvailData.IsVisible = true; } } else { slStandardLayout.IsVisible = false; _EmployeeModel = await EmployeeModel.GetEmployeeCount(); if (!string.IsNullOrEmpty(Convert.ToString(_EmployeeModel.Total)) && !string.IsNullOrEmpty(Convert.ToString(_EmployeeModel.TotalMale)) && !string.IsNullOrEmpty(Convert.ToString(_EmployeeModel.TotalFemale))) { lblTotalValue.Text = Convert.ToString(_EmployeeModel.Total); lblTotalMaleValue.Text = Convert.ToString(_EmployeeModel.TotalMale); lblTotalFeMalValue.Text = Convert.ToString(_EmployeeModel.TotalFemale); slEmployee.IsVisible = true; } else { _NotAvailData.IsVisible = false; } } } } catch (Exception ex) { } }; pcrStandard.SelectedIndexChanged += async(sender, e) => { using (UserDialogs.Instance.Loading("Loading")) { string standardName = lblStandard.Text = pcrStandard.Items[pcrStandard.SelectedIndex]; int standardID = _StandardList.Where(x => x.Name == standardName).FirstOrDefault().Id; _StudentHeadCountModelList = await StudentHeadCountModel.GetStudentHeadCount(9); if (_StudentHeadCountModelList != null && _StudentHeadCountModelList.Count > 0) { Items = new ObservableCollection <StudentHeadCountModel>(_StudentHeadCountModelList); _NotAvailData.IsVisible = false; studentHeadCountListView.ItemsSource = Items; } else { _NotAvailData.IsVisible = true; } } }; StackLayout slStudent = new StackLayout { Children = { slStandardLayout, studentHeadCountListView }, Orientation = StackOrientation.Vertical }; StackLayout slHeadCount = new StackLayout { Children = { new StackLayout { Padding = new Thickness(20, Device.OnPlatform(40, 20, 0), 20, 20), Children = { slTitle, spTitle.LineSeperatorView, slTypeLayout, _NotAvailData, slEmployee, slStudent }, VerticalOptions = LayoutOptions.FillAndExpand, }, }, BackgroundColor = LayoutHelper.PageBackgroundColor }; Content = new ScrollView { Content = slHeadCount, }; } catch (Exception ex) { } }