private async void OnEditInfo_Tapped(object sender, EventArgs e) { loadingPopup.IsVisible = true; if (ModalDangKyMoiGioi.Body == null) { dangKyMoiGioiView = new DangKyMoiGioiContentView(LookUpModal, Guid.Parse(UserLogged.Id)); dangKyMoiGioiView.OnSaved += async(s, e2) => { dangKyMoiGioiView.viewModel.MoiGioi.UserId = viewModel.MoiGioi.UserId; dangKyMoiGioiView.viewModel.MoiGioi.User = viewModel.MoiGioi.User; dangKyMoiGioiView.viewModel.MoiGioi.RegisterDate = viewModel.MoiGioi.RegisterDate; viewModel.MoiGioi = dangKyMoiGioiView.viewModel.MoiGioi; viewModel.GetTypeFormatString(viewModel.MoiGioi.Type); await ModalDangKyMoiGioi.Hide(); }; dangKyMoiGioiView.OnCancel += async(object s, EventArgs e2) => await ModalDangKyMoiGioi.Hide(); ModalDangKyMoiGioi.Body = dangKyMoiGioiView; ModalDangKyMoiGioi.CustomCloseButton(dangKyMoiGioiView.Cancel_Clicked); } dangKyMoiGioiView.InitUpdate(viewModel.MoiGioi); await ModalDangKyMoiGioi.Show(); loadingPopup.IsVisible = false; }
private async void DangKyMoiGioi_Clicked(object sender, EventArgs e) { if (!UserLogged.IsLogged) { await Shell.Current.DisplayAlert(Language.thong_bao, Language.vui_long_dang_nhap_de_dang_ky_moi_gioi, Language.dong); ((AppShell)Shell.Current).SetLoginPageActive(); return; } if (UserLogged.Type == 1) { await Shell.Current.DisplayAlert("", Language.ban_dang_la_moi_gioi, Language.dong); } else { if (ModalDangKyMoiGioi.Body == null) { var dangKyMoiGioiContentView = new DangKyMoiGioiContentView(LookUpModal, Guid.Parse(UserLogged.Id)); dangKyMoiGioiContentView.OnSaved += async(object s, EventArgs e2) => { FrameBtnDangKyMoiGioi.IsVisible = false; await ModalDangKyMoiGioi.Hide(); await Shell.Current.GoToAsync("//quanlymoigioi"); }; dangKyMoiGioiContentView.OnCancel += async(object ssender, EventArgs e2) => await ModalDangKyMoiGioi.Hide(); ModalDangKyMoiGioi.Body = dangKyMoiGioiContentView; ModalDangKyMoiGioi.CustomCloseButton(dangKyMoiGioiContentView.Cancel_Clicked); } await ModalDangKyMoiGioi.Show(); } }
private async void EmployeeRegister_Clicked(object sender, EventArgs e) { if (!UserLogged.IsLogged) { await DisplayAlert(Language.thong_bao, Language.vui_long_dang_nhap_de_gui_ho_so_dang_ky_nhan_vien, Language.dong); ((AppShell)Shell.Current).SetLoginPageActive(); return; } if (UserLogged.Type == 1) { //Dang ky nhan vien var confirm = await DisplayAlert(Language.xac_nhan, $"{Language.ban_co_chac_chan_muon_gui_ho_so_dang_nhan_vien_cho_cong_ty} {this.Company.Name}?", Language.dong_y, Language.tu_choi); if (!confirm) { return; } var responseRegisterEmployee = await ApiHelper.Post(ApiRouter.EMPLOYEE_REGISTER + this.Company.Id, null, true); if (responseRegisterEmployee.IsSuccess) { await DisplayAlert("", Language.dang_ky_nhan_vien_thanh_cong, Language.dong); } else { await DisplayAlert("", Language.ban_da_gui_ho_so_den_cong_ty_va_dang_cho_xet_duyet_vui_long_doi, Language.dong); } } else { var confirm = await DisplayAlert(Language.xac_nhan, Language.de_dang_ky_nha_vien_ban_phai_dang_ky_moi_gioi_truoc_ban_muon_dang_ky_moi_gioi_khong, Language.dong_y, Language.tu_choi); if (confirm == false) { return; } //Dang ky moi gioi if (ModalDangKyMoiGioi.Body == null) { var dangKyMoiGioiContentView = new DangKyMoiGioiContentView(LookUpModal, Guid.Parse(UserLogged.Id)); dangKyMoiGioiContentView.OnSaved += async(object s, EventArgs e2) => { await ModalDangKyMoiGioi.Hide(); EmployeeRegister_Clicked(null, EventArgs.Empty); }; dangKyMoiGioiContentView.OnCancel += async(object ssender, EventArgs e2) => await ModalDangKyMoiGioi.Hide(); ModalDangKyMoiGioi.Body = dangKyMoiGioiContentView; ModalDangKyMoiGioi.CustomCloseButton(dangKyMoiGioiContentView.Cancel_Clicked); } await ModalDangKyMoiGioi.Show(); } }
private async Task DangKyMoiGioi() { if (ModalDangKyMoiGioi.Body == null) { var dangKyMoiGioiContentView = new DangKyMoiGioiContentView(LookUpModal, Guid.Parse(UserLogged.Id)); dangKyMoiGioiContentView.OnSaved += async(object sender, EventArgs e) => { await ModalDangKyMoiGioi.Hide(); await Shell.Current.GoToAsync("//" + AppShell.QUANLYMOIGIOI); }; dangKyMoiGioiContentView.OnCancel += async(object sender, EventArgs e) => await ModalDangKyMoiGioi.Hide(); ModalDangKyMoiGioi.Body = dangKyMoiGioiContentView; ModalDangKyMoiGioi.CustomCloseButton(dangKyMoiGioiContentView.Cancel_Clicked); } await ModalDangKyMoiGioi.Show(); }