async void OnClicked_LoginButton(object sender, EventArgs e) { using (UserDialogs.Instance.Loading(InfoText.PopupLoading_Text)) { var email = txtEmail.Text; var password = txtPassword.Text; var loginResponse = await ValidateAuth(email, password); if (loginResponse.IsFirstLogin) { var verificationCode = await DisplayPromptAsync( "Enter Verification Code", "Verification code is required for first time login", "OK", "Cancel", null, -1, null, ""); loginResponse = await ValidateAuth(email, password, verificationCode); } if (!loginResponse.Valid) { await AlertProvider.ErrorAlert(this, loginResponse.Error); } else { DB.SetValue(StorageEnum.Email, email); DB.SetValue(StorageEnum.UserID, loginResponse.UserId.ToString()); Application.Current.MainPage = new NavigationPage(new MainPage()); } } }
void MainForm_Shown(object sender, EventArgs e) { ABCScreen.SplashUtils.CloseSplash(); this.Activate(); this.ChatScreen.StartTimer(); this.NotifiesList.ReloadNotifies(true); AlertProvider.ShowAlerts(); }
private async Task <FundraisingDetail> GetDetails() { var response = await Api.GetFundraisingDetail(_campaignID); if (!string.IsNullOrEmpty(response.Error)) { await AlertProvider.ErrorAlert(this, response.Error); return(new FundraisingDetail()); } return(response); }
public void InitializeControls( ) { lstGridControls = new Dictionary <Guid, ABCGridControl>(); this.xtraTabControl1.TabPages.Clear(); foreach (GEAlertsInfo alertInfo in AlertProvider.GetAlertConfigs(ABCUserProvider.CurrentUser.ADUserID).Values) { DevExpress.XtraTab.XtraTabPage tabPage = new DevExpress.XtraTab.XtraTabPage(); tabPage.Name = alertInfo.Name; tabPage.Text = alertInfo.ShortCaption; this.xtraTabControl1.TabPages.Add(tabPage); ABCGridControl GridCtrl = new ABCGridControl(); GridCtrl.Initialize(alertInfo.TableName); GridCtrl.Tag = alertInfo; GridCtrl.Dock = System.Windows.Forms.DockStyle.Fill; GridCtrl.Parent = tabPage; GridCtrl.ShowSaveButton = false; GridCtrl.ShowDeleteButton = false; GridCtrl.ShowRefreshButton = false; GridCtrl.EnableFocusedCell = false; GridCtrl.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus; GridCtrl.BringToFront(); lstGridControls.Add(alertInfo.GEAlertID, GridCtrl); } if (this.xtraTabControl1.TabPages.Count <= 3) { this.xtraTabControl1.HeaderLocation = DevExpress.XtraTab.TabHeaderLocation.Top; } else { this.xtraTabControl1.HeaderLocation = DevExpress.XtraTab.TabHeaderLocation.Left; } this.Shown += new EventHandler(AlertView_Shown); this.ShowInTaskbar = false; this.StartPosition = FormStartPosition.CenterScreen; this.Text = "Thông báo"; }
public void ReloadDatas( ) { foreach (Guid iD in lstGridControls.Keys) { List <BusinessObject> lstObjs = AlertProvider.GetAlertData(iD); ABCGridControl GridCtrl = lstGridControls[iD]; #region datasource BindingSource binding = new BindingSource(); GridCtrl.GridDataSource = binding; GridCtrl.RefreshDataSource(); object datasource = null; Type objType = BusinessObjectFactory.GetBusinessObjectType(GridCtrl.TableName); if (objType != null) { Type typeABCList = typeof(ABCList <>).MakeGenericType(objType); MethodInfo method; if (typeABCList != null) { datasource = ABCBusinessEntities.ABCDynamicInvoker.CreateInstanceObject(typeABCList); method = typeABCList.GetMethod("LoadData", new Type[] { typeof(List <BusinessObject>) }); method.Invoke(datasource, new object[] { lstObjs }); } } binding.DataSource = datasource; binding.ResetBindings(false); #endregion if (lstObjs.Count <= 0) { GridCtrl.Parent.Visible = false; } GridCtrl.GridDefaultView.BestFitColumns(); } }
private async Task <List <FundraisingModel> > GetListing(string search = "") { var response = await Api.GetFundraisingList(new Api.GetFundraisingListRequest { SearchName = search }); if (!string.IsNullOrEmpty(response.Error)) { await AlertProvider.ErrorAlert(this, response.Error); return(new List <FundraisingModel>()); } return(response.Items.Select(a => new FundraisingModel { ID = a.ID, Image = a.Image, Description = a.Description, Name = a.Name, ValidTill = $"Valid Until {a.ValidTill}", Url = a.Url }).ToList()); }
private async void OnClicked_Download(object sender, EventArgs e) { var voucherDetails = ((ImageButton)sender).CommandParameter as VoucherModel; await AlertProvider.SuccessAlert(this, $"Download with Name: {voucherDetails.VoucherDescription}"); }
private async void OnClicked_Share(object sender, EventArgs e) { var voucherDetails = ((ImageButton)sender).CommandParameter as VoucherModel; await AlertProvider.SuccessAlert(this, $"Share with Name: {voucherDetails.Name}"); }