/// <summary> /// TODO : To Validate Submit Command... /// </summary> /// <param name="obj"></param> private async void SubmitCommandAsync(object obj) { if (!await Validate()) { return; } //Call api.. try { //Call AccessRegister Api.. UserDialogs.Instance.ShowLoading("Please Wait…", MaskType.Clear); if (CrossConnectivity.Current.IsConnected) { await Task.Run(async() => { if (_businessCode != null) { await _businessCode.AccessPasswordReminderApi(new AccessPasswordReminderRequestModel() { emailaddress = Email, }, async(aobj) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (aobj as AccessPasswordReminderResponseModel); if (requestList != null) { if (requestList.responsecode == 100) { // UserDialog.HideLoading(); await Navigation.PushModalAsync(new Views.ResetPassword.UpdatePasswordPage(Email)); } else { await App.Current.MainPage.DisplayAlert("", requestList.responsemessage, "Ok"); } } UserDialog.HideLoading(); }); }, (objj) => { Device.BeginInvokeOnMainThread(async() => { UserDialog.HideLoading(); UserDialog.Alert("Something went wrong. Please try again later.", "", "Ok"); }); }); } }).ConfigureAwait(false); } else { UserDialogs.Instance.Loading().Hide(); await UserDialogs.Instance.AlertAsync("No Network Connection found, Please try again!", "", "Okay"); } } catch (Exception ex) { UserDialog.HideLoading(); } }
private async void SelectDealer_Click(object sender, RoutedEventArgs e) { var dialog = new UserDialog(); ContentDialogResult button; do { button = await dialog.EnqueueAndShowIfAsync(); } while (button == ContentDialogResult.Primary && dialog.User.Role != RoleEnum.Dealer); if (button == ContentDialogResult.Primary) { User dealer = dialog.User; DealerGUID.Text = dealer.Id.ToString(); SelectedDealer.Text = $"Selected Dealer: {dealer.FirstName} {dealer.LastName}"; if (keyValuePairs.ContainsKey("Dealer")) { keyValuePairs.Remove("Dealer"); } keyValuePairs.Add("Dealer", x => x.DealerId == dealer.Id); UpdateSearchResult(); } }
/// <summary> /// TODO : To Validate reset password Fields... /// </summary> /// <returns></returns> public async Task <bool> Validate() { if (string.IsNullOrEmpty(Token)) { UserDialog.Alert("Please enter Token."); return(false); } if (Token.Length >= 20) { UserDialog.Alert("Reset code should not be more than 20 chracters."); return(false); } if (string.IsNullOrEmpty(NewPassword)) { UserDialog.Alert("Please enter new password."); return(false); } if (NewPassword.Length < 6 || NewPassword.Length > 50) { UserDialog.Alert("Password length should be between 6 - 50 charcters."); return(false); } bool isValid = (Regex.IsMatch(NewPassword, _password, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250))); if (!isValid) { UserDialogs.Instance.Alert("Password must contain minimum 6 charachters and at least 1 letter, 1 number and 1 special character.", "Alert", "Ok"); return(false); } return(true); }
private void OnGUI() { using (GUILayoutHelper.Vertical()) { email = EditorGUILayout.TextField("E-Mail", email); bugTitle = EditorGUILayout.TextField("Title", bugTitle); statusScroll = EditorGUILayout.BeginScrollView(statusScroll, false, false); description = GUILayout.TextArea(description, GUILayout.ExpandHeight(true)); EditorGUILayout.EndScrollView(); if (GUILayout.Button("Send")) { bool sendBug = true; if (string.IsNullOrEmpty(email)) { email = "no@email"; } if (sendBug && string.IsNullOrEmpty(bugTitle)) { UserDialog.DisplayDialog("Need Title", "You need to give the bug a title", "OK"); sendBug = false; } if (sendBug && (string.IsNullOrEmpty(description) || description == defaultDescription)) { UserDialog.DisplayDialog("Need Description", "You need to give the bug a description", "OK"); sendBug = false; } if (sendBug) { FogbugzUtilities.SubmitUserBug(bugTitle, description, email); Close(); } } } }
private void btnEdit_Click(object sender, EventArgs e) { if (dgvUserDetail.RowCount != 0) { int userId = (int)(dgvUserDetail.SelectedRows[0].Cells[0].Value); UserDialog dlgUser = new UserDialog(); UserBO objUserBO = new UserBO(); UserData objUserData = new UserData(); dlgUser.UserName = (dgvUserDetail.SelectedRows[0].Cells[1].Value).ToString(); dlgUser.Password = (dgvUserDetail.SelectedRows[0].Cells[2].Value).ToString(); dlgUser.FirstName = (dgvUserDetail.SelectedRows[0].Cells[3].Value).ToString(); dlgUser.LastName = (dgvUserDetail.SelectedRows[0].Cells[4].Value).ToString(); dlgUser.EmailId = (dgvUserDetail.SelectedRows[0].Cells[5].Value).ToString(); dlgUser.PhoneNo = (dgvUserDetail.SelectedRows[0].Cells[6].Value).ToString(); dlgUser.IsActive = (bool)(dgvUserDetail.SelectedRows[0].Cells[7].Value); if (dlgUser.ShowDialog() == DialogResult.OK) { objUserData.UserId = userId; objUserData.FirstName = dlgUser.FirstName; objUserData.LastName = dlgUser.LastName; objUserData.EmailId = dlgUser.EmailId; objUserData.PhoneNo = dlgUser.PhoneNo; objUserData.Password = dlgUser.Password; objUserData.IsActive = dlgUser.IsActive; objUserBO.UpdateInUser(objUserData); } dgvUserDetail.DataSource = UserBO.GetUser(); } }
/// <summary> /// Creates a Yes/No dialog /// </summary> /// <param name="title">Dialog title</param> /// <param name="question">Dialog question</param> /// <param name="primaryButtonText">Text that appears on the "yes" button</param> /// <param name="secondaryButtonText">Text that appears on the "no" button</param> public async Task <bool> YesNoAsync( string title, string question, string primaryButtonText = null, string secondaryButtonText = null) { if (_uiManager == null) { return(false); } if (string.IsNullOrWhiteSpace(primaryButtonText)) { primaryButtonText = Common.GetLocalizedText("YesButton/Content"); } if (string.IsNullOrWhiteSpace(secondaryButtonText)) { secondaryButtonText = Common.GetLocalizedText("NoButton/Content"); } var tcs = new TaskCompletionSource <bool>(); await Dispatcher?.RunAsync(CoreDispatcherPriority.Normal, async() => { UserDialog dlg = new UserDialog(title, question, primaryButtonText, secondaryButtonText); ContentDialogResult dialogResult = await _uiManager?.RunExclusiveTaskAsync(() => dlg.ShowAsync().AsTask()); tcs.SetResult(dlg.Result); }); bool yesNo = await tcs.Task; return(yesNo); }
public async Task <bool> ValidateLoanDetail() { if (string.IsNullOrEmpty(Employer)) { UserDialog.Alert("Please select employer."); return(false); } if (DateOfBirth == "Select Start date") { UserDialog.Alert("Please select start date."); return(false); } if (string.IsNullOrEmpty(EnterSalary)) { UserDialog.Alert("Please enter salary."); return(false); } if (string.IsNullOrEmpty(EnterEmployeeNumber)) { UserDialog.Alert("Please enter employee number."); return(false); } if (string.IsNullOrEmpty(PartImgBase64)) { UserDialog.Alert("Please upload id card."); return(false); } return(true); }
/// <summary> /// TODO : To Validate User ValidateEmployement Fields... /// </summary> /// <returns></returns> public async Task <bool> ValidateLoan() { if (string.IsNullOrEmpty(EnterAmount)) { UserDialog.Alert("Please enter amount."); return(false); } if (string.IsNullOrEmpty(SelectPurpose)) { UserDialog.Alert("Please select purpose."); return(false); } if (string.IsNullOrEmpty(RepaymentType)) { UserDialog.Alert("Please select repayment type."); return(false); } if (string.IsNullOrEmpty(LoanDuration)) { UserDialog.Alert("Please select duration."); return(false); } if (string.IsNullOrEmpty(NumberOfWeek)) { UserDialog.Alert("Please enter no. of duration."); return(false); } return(true); }
/// <summary> /// To Validate all User Input Fields... /// </summary> /// <returns></returns> private async Task <bool> Validate() { UserDialog.ShowLoading("Please Wait…", MaskType.Clear); if (IsBuyRate) { if (string.IsNullOrEmpty(BuyRate)) { UserDialog.HideLoading(); UserDialog.Alert("Please enter buy rate.", "", "Ok"); return(false); } } else { if (string.IsNullOrEmpty(SellRate)) { UserDialog.HideLoading(); UserDialog.Alert("Please enter sell rate.", "", "Ok"); return(false); } } if (string.IsNullOrEmpty(ExpireTime)) { UserDialog.HideLoading(); UserDialog.Alert("Please enter expire time.", "", "Ok"); return(false); } UserDialog.HideLoading(); return(true); }
private void btnEditUser_Click(object sender, EventArgs e) { UserDialog dialog; dialog = new UserDialog(selectedUser, this); dialog.Show(); }
private void btnAddUser_Click(object sender, EventArgs e) { UserDialog dialog; dialog = new UserDialog(this); dialog.Show(); }
/// <summary> /// Call This Api For StaticDataSearch /// </summary> /// <returns></returns> public async Task StaticDataSearch() { if (!string.IsNullOrEmpty(Helpers.Settings.GeneralStaticDataResponse)) { var objres = JsonConvert.DeserializeObject <StaticDataSearchResponseModel>(Helpers.Settings.GeneralStaticDataResponse); Helpers.Constants.StaticDataList = new ObservableCollection <Staticdata>(objres.staticdata); } else { //Call api.. try { //Call AccessRegisterActivate Api.. //UserDialogs.Instance.ShowLoading("Loading...", MaskType.Clear); if (CrossConnectivity.Current.IsConnected) { await Task.Run(async() => { if (_businessCode != null) { await _businessCode.StaticDataSearchApi(new StaticDataSearchRequestModel() { }, async(obj) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (obj as StaticDataSearchResponseModel); if (requestList != null) { Staticdatalist = new ObservableCollection <Staticdata>(requestList.staticdata); Helpers.Constants.StaticDataList = Staticdatalist; } else { UserDialogs.Instance.HideLoading(); UserDialogs.Instance.Alert("Something went wrong please try again.", "", "OK"); } UserDialog.HideLoading(); }); }, (objj) => { Device.BeginInvokeOnMainThread(async() => { UserDialog.HideLoading(); UserDialog.Alert("Something went wrong. Please try again later.", "", "Ok"); }); }); } }).ConfigureAwait(false); } else { } } catch (Exception ex) { UserDialog.HideLoading(); } } }
public MainViewModel() { _currentWindow = System.Windows.Application.Current.Windows.OfType <MetroWindow>().LastOrDefault(); _backupDialog = new BackupDialog(); _restoreBackupDialog = new RestoreBackupDialog(); _userDialog = new UserDialog(); _loginDialog = new Views.MainViews.LoginDialog(); }
private void GlobalJavascriptObject() { if ((webView == null) || !webView.IsLive) { return; } JSObject myGlobalObject = webView.CreateGlobalJavascriptObject("cshandler"); //JSObject stropheConnection = webView.CreateGlobalJavascriptObject("stropheConnection"); if (!myGlobalObject) { return; } myGlobalObject.Bind("openNewDialog", (args) => { var jid = args[0].ToString(); UserDialog ud; if (dialogs.ContainsKey(jid)) { ud = dialogs[jid]; } else { ud = new UserDialog(jid, args[1].ToString(), webView); dialogs.Add(jid, ud); ud.FormClosed += (sender, e) => dialogs.Remove(jid); } ud.Show(); return(new JSValue(true)); }); myGlobalObject.Bind("alert", (message) => { MessageBox.Show(message[0]); return(JSValue.Undefined); }); myGlobalObject.Bind("DistributionMessage", (args) => { var jid = args[0].ToString(); var name = args[1].ToString(); var msg = args[2].ToString(); UserDialog ud; if (dialogs.ContainsKey(jid)) { ud = dialogs[jid]; } else { ud = new UserDialog(jid, name, webView); dialogs.Add(jid, ud); ud.FormClosed += (sender, e) => dialogs.Remove(jid); ud.Show(); } ud.Focus(); ud.RecMessage(msg); return(JSValue.Undefined); }); }
private void userPic_Click(object sender, EventArgs e) { UserDialog dialog = new UserDialog(); if (dialog.ExecuteDialog(NameText.Text, UrlText.Text)) { NameText.Text = dialog.SelectedUser.LoginName; } }
private void pictureBox2_Click(object sender, EventArgs e) { UserDialog dialog = new UserDialog(); if (dialog.ExecuteDialog(DestUserText.Text, SquadronContext.Url)) { DestUserText.Text = dialog.SelectedUser.LoginName; } }
private void userPicture1_Click(object sender, EventArgs e) { UserDialog dialog = new UserDialog(); if (dialog.ExecuteDialog(SourceUserText.Text, SquadronContext.Url)) { SourceUserText.Text = dialog.SelectedUser.LoginName; } }
//TODO : To Call Api To Get All Payments... public async Task GetAllPayments() { //Call api.. try { UserDialogs.Instance.ShowLoading(); if (CrossConnectivity.Current.IsConnected) { await Task.Run(async() => { if (_businessCode != null) { await _businessCode.PaymentSearchApi(new PaymentSearchRequestModel() { usertoken = MonicaLoanApp.Helpers.Settings.GeneralAccessToken }, async(obj) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (obj as PaymentSearchResponseModel).payments; if (requestList.Count > 0) { UserDialogs.Instance.HideLoading(); PaymentList = new ObservableCollection <Payment>(requestList); IsPaymentNotAvailable = false; IsPaymentAvailable = true; } else { UserDialogs.Instance.HideLoading(); IsPaymentNotAvailable = true; IsPaymentAvailable = false; } UserDialog.HideLoading(); }); }, (objj) => { Device.BeginInvokeOnMainThread(async() => { UserDialog.HideLoading(); UserDialog.Alert("Something went wrong. Please try again later.", "", "Ok"); }); }); } }).ConfigureAwait(false); } else { UserDialogs.Instance.Loading().Hide(); await UserDialogs.Instance.AlertAsync("No Network Connection found, Please try again!", "", "Okay"); } } catch (Exception ex) { UserDialog.HideLoading(); } }
/// <summary> /// Call This Api For AccessRegisterActivate /// </summary> /// <returns></returns> public async Task AccessRegisterActivate() { //Call api.. try { //Call AccessRegisterActivate Api.. UserDialogs.Instance.ShowLoading("Please Wait…", MaskType.Clear); if (CrossConnectivity.Current.IsConnected) { await Task.Run(async() => { if (_businessCode != null) { await _businessCode.AccessRegisterActivateApi(new AccessRegisterActivateRequestModel() { usertoken = Constants.UserToken, validatetoken = "806207727" }, async(obj) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (obj as AccessRegisterResponseModel); //if (requestList != null) //{ // Helpers.Constants.ObjSetUserProfile.birthDate = UserDOB; // Helpers.Constants.ObjSetUserProfile.bloodType = BloodGroupType; // Helpers.Constants.ObjSetUserProfile.emailAddress = UserEmail; // Helpers.Constants.ObjSetUserProfile.fullName = UserFullName; // Helpers.Constants.ObjSetUserProfile.height = Convert.ToInt32(UserHeight); // Helpers.Constants.ObjSetUserProfile.mobilePhone = UserPhoneNumber; // Helpers.Constants.ObjSetUserProfile.weight = Convert.ToInt32(UserWeight); // UserDialog.Alert("Profile updated successfully.", "Success", "Ok"); //} UserDialog.HideLoading(); }); }, (objj) => { Device.BeginInvokeOnMainThread(async() => { UserDialog.HideLoading(); UserDialog.Alert("Something went wrong. Please try again later.", "", "Ok"); }); }); } }).ConfigureAwait(false); } else { UserDialogs.Instance.Loading().Hide(); await UserDialogs.Instance.AlertAsync("No Network Connection found, Please try again!", "", "Okay"); } } catch (Exception ex) { UserDialog.HideLoading(); } }
public UserDialog CreateUserDialog(User user, User companion, Dialog dialog) { UserDialog ud = new UserDialog { User = user, Companion = companion, Dialog = dialog }; _context.UserDialogs.Add(ud); return(ud); }
public async Task GetNewProfileData() { try { UserDialogs.Instance.ShowLoading("Please Wait…", MaskType.Clear); if (CrossConnectivity.Current.IsConnected) { await Task.Run(async() => { if (_businessCode != null) { await _businessCode.ProfileGetApi(new ProfileRequestModel() { profiletoken = Helpers.LocalStorage.GeneralProfileToken }, async(objs) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (objs as ProfileDetailsResponseModel); if (requestList != null) { UserDialog.HideLoading(); DisplayName = requestList.displayname; Mobileno = requestList.mobilenumber; EmailAddress = requestList.emailaddress == null ? string.Empty : requestList.emailaddress; UserProfileBase64 = requestList.profilepic; MessagingCenter.Send <string>("", "LoadApiImage"); } }); }, (objj) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (objj as RegisterProfileResponseModel); if (requestList != null) { UserDialog.HideLoading(); UserDialogs.Instance.Alert(requestList.responsemessage, "", "ok"); } }); }); } }).ConfigureAwait(false); } else { //UserDialogs.Instance.Loading().Hide(); //await UserDialogs.Instance.AlertAsync("No Network Connection found, Please try again!", "", "Okay"); } } catch (Exception ex) { UserDialog.HideLoading(); } }
/// <summary> /// Call This Api For StaticDataSearch /// </summary> /// <returns></returns> public async Task StaticDataSearch() { //Fileter Bank List From Static Data List.. try { var EmployerList = Helpers.Constants.StaticDataList.Where(a => a.type == "EMPLOYER").ToList(); SelectLoan = new ObservableCollection <Staticdata>(EmployerList); } catch (Exception ex) { UserDialog.HideLoading(); } }
private async void NewContact_Click(object sender, RoutedEventArgs e) { ContentDialog dialog = new UserDialog() { FullSizeDesired = true, MaxWidth = ActualWidth // Required for Mobile! }; await dialog.ShowAsync(); ReadDB(); }
/// <summary> /// Call This Api For StaticDataSearch /// </summary> /// <returns></returns> public async Task StaticDataSearch() { //Fileter Bank List From Static Data List.. try { var filteredStatelist = Helpers.Constants.StaticDataList.Where(a => a.type == "FAQ").ToList(); FaqList = new ObservableCollection <Staticdata>(filteredStatelist); } catch (Exception ex) { UserDialog.HideLoading(); } }
public async Task GetLoans() { //Call api.. try { //UserDialogs.Instance.ShowLoading("Loading...", MaskType.Clear); if (CrossConnectivity.Current.IsConnected) { await Task.Run(async() => { if (_businessCode != null) { await _businessCode.LoanSearchApi(new LoanSearchRequestModel() { usertoken = MonicaLoanApp.Helpers.Settings.GeneralAccessToken, loannumber = LoanNumber }, async(obj) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (obj as LoanSearchResponseModel).loans; if (requestList != null) { UserDialogs.Instance.HideLoading(); SchedulesList = new ObservableCollection <Schedule>(requestList[0].schedules); } else { UserDialogs.Instance.HideLoading(); UserDialogs.Instance.Alert("Something went wrong please try again.", "", "OK"); } UserDialog.HideLoading(); }); }, (objj) => { Device.BeginInvokeOnMainThread(async() => { UserDialog.HideLoading(); UserDialog.Alert("Something went wrong. Please try again later.", "", "Ok"); }); }); } }).ConfigureAwait(false); } else { UserDialogs.Instance.Loading().Hide(); await UserDialogs.Instance.AlertAsync("No Network Connection found, Please try again!", "", "Okay"); } } catch (Exception ex) { UserDialog.HideLoading(); } }
static void Main(string[] args) { UserDialog.DisplayGreetings("Welcome to my App"); PhoneBook pb = new PhoneBook(); RequestHandler rh = new RequestHandler(pb); while (rh.ActionChooser()) { ; } }
static void Main(string[] args) { var dialogService = IoC.IoC.Container.GetInstance <IDialogService>(); var graph = dialogService.GetAll().First(); SharedDialog = new UserDialog(new StatefulDialog(graph)); Bot.OnMessage += BotOnMessageReceived; Bot.OnCallbackQuery += Bot_OnCallbackQuery; Bot.StartReceiving(); Console.ReadLine(); }
/// <summary> /// To perform Accept/Reject Action on Search... /// </summary> /// <returns></returns> public async Task PerformActionOnMatches(string action, string matchnum) { try { UserDialogs.Instance.ShowLoading("Please Wait…", MaskType.Clear); if (CrossConnectivity.Current.IsConnected) { await Task.Run(async() => { if (_businessCode != null) { await _businessCode.MatchesRespondApi(new MatchesRespondRequestModel() { profiletoken = Helpers.LocalStorage.GeneralProfileToken, requestnumber = Currency.requestnumber, action = action, matchnumber = matchnum.ToString(), }, async(objs) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (objs as ResendTokenResponseModel); if (requestList != null) { UserDialog.HideLoading(); } }); }, (objj) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (objj as ResendTokenResponseModel); if (requestList != null) { UserDialog.HideLoading(); UserDialogs.Instance.Alert(requestList.responsemessage, "", "ok"); } }); }); } }).ConfigureAwait(false); } else { UserDialogs.Instance.Loading().Hide(); await UserDialogs.Instance.AlertAsync("No Network Connection found, Please try again!", "", "Okay"); } } catch (Exception ex) { UserDialog.HideLoading(); } }
/// <summary> /// TODO : To Perform Resend Code Operation... /// </summary> /// <param name="obj"></param> private async void ResendCodeAsync(object obj) { try { UserDialogs.Instance.ShowLoading("Please Wait…", MaskType.Clear); if (CrossConnectivity.Current.IsConnected) { await Task.Run(async() => { if (_businessCode != null) { await _businessCode.AccessPasswordResendCodeApi(new ResendCodeRequestModel() { emailaddress = Email, }, async(objs) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (objs as AccessPasswordChangeResponseModel); if (requestList != null) { UserDialog.HideLoading(); UserDialogs.Instance.Alert(requestList.responsemessage, "", "ok"); Xamarin.Forms.MessagingCenter.Send <string>("", "StartCountDown"); } }); }, (objj) => { Device.BeginInvokeOnMainThread(async() => { var requestList = (obj as AccessPasswordChangeResponseModel); if (requestList != null) { UserDialog.HideLoading(); UserDialogs.Instance.Alert(requestList.responsemessage, "", "ok"); } }); }); } }).ConfigureAwait(false); } else { UserDialogs.Instance.Loading().Hide(); await UserDialogs.Instance.AlertAsync("No Network Connection found, Please try again!", "", "Okay"); } } catch (Exception ex) { UserDialog.HideLoading(); } }
private void SelectEmployee() { var dialog = new UserDialog(Environment.EmployeeSearchString, "search=" + HttpUtility.UrlEncode(textEmp.Text).Replace("+", "%20") + "&" + paramStr); dialog.DialogEvent += UserDialog_DialogEvent; dialog.Show(); var findForm = FindForm(); if (findForm != null) { findForm.Enabled = false; } }