private void googleMap1_MapClick(object sender, Web.Ext.GoogleMaps.MapMouseEventArgs e) { if (e.Marker == null) { AlertBox.Show("You clicked location: " + e.Location.ToString()); } else { AlertBox.Show("You clicked marker: " + e.Marker + " at location: " + e.Location.ToString()); } }
private void BuyButton_Click(object sender, RoutedEventArgs e) { var b = sender as Button; var recipe = b.CommandParameter as Recipe; if (User.Instance.Gold >= recipe.Value) { var buyRecipeInlines = new List <Inline> { new Run("Are you sure you want to buy "), new Run($"{recipe.Name}") { FontFamily = (FontFamily)FindResource("FontRegularDemiBold") }, new Run(" for "), new Run($"{recipe.Value} gold") { Foreground = (SolidColorBrush)FindResource("BrushGold"), FontFamily = (FontFamily)FindResource("FontRegularDemiBold") }, new Run("?") }; var result = AlertBox.Show(buyRecipeInlines); if (result == MessageBoxResult.No) { return; } (Application.Current.MainWindow as GameWindow).CreateFloatingTextUtility($"-{recipe.Value}", (SolidColorBrush)FindResource("BrushGold"), FloatingTextHelper.GoldPositionPoint); recipe.AddItem(); User.Instance.Gold -= recipe.Value; Specializations.UpdateSpecializationAmountAndUi(SpecializationType.Trading); UpdateShop(); } else { var notEnoughGoldInlines = new List <Inline> { new Run("You do not have enough gold to buy this item.\nIt costs "), new Run($"{recipe.Value} gold") { Foreground = (SolidColorBrush)FindResource("BrushGold"), FontFamily = (FontFamily)FindResource("FontRegularDemiBold") }, new Run(".\nYou can get more gold by completing quests and selling loot from monsters and bosses.") }; AlertBox.Show(notEnoughGoldInlines, MessageBoxButton.OK); } }
private void btnSimpleNotification_Click(object sender, EventArgs e) { if (Wisej.Web.Ext.Notification.Notification.IsSupported) { notificationObj.Show("Notification", "Direct notification"); } else { AlertBox.Show("Notification is not supported on this Browser"); } }
private void textBox3_ToolClick(object sender, ToolClickEventArgs e) { if (String.IsNullOrEmpty(this.textBox3.Text)) { AlertBox.Show("Cannot send an email to an empty address! ", icon: MessageBoxIcon.Error); } else { AlertBox.Show("I'm sending an email to " + this.textBox3.Text); } }
/// <summary> /// Execute the command /// </summary> /// <param name="parameter">the parameter</param> public override void Execute(object parameter) { try { _execute.Invoke(parameter); } catch (Exception ex) { AlertBox.ShowError(ex); } }
public static AlertBox CreateAndAddAlertBox(SceneMgr mgr, Vector position) { AlertBox box = new AlertBox(); mgr.GetCanvas().Children.Add(box); Canvas.SetLeft(box, position.X); Canvas.SetTop(box, position.Y); Canvas.SetZIndex(box, 100); return(box); }
public void InitElement() { mgr.BeginInvoke(new Action(() => { element = (AlertBox)LogicalTreeHelper.FindLogicalNode(mgr.GetCanvas(), "AlertBoxUC"); if (element == null) { Size size = SharedDef.VIEW_PORT_SIZE; element = GuiObjectFactory.CreateAndAddAlertBox(mgr, new Vector((SharedDef.VIEW_PORT_SIZE.Width - 395) / 2, 0)); } })); }
public void showAlert(string message, AlertBox.MessageType type = AlertBox.MessageType.Success) { AlertBox alertBox = new AlertBox(); DispatcherTimer alertTimeout = new DispatcherTimer(); alertBox.SetMessage(message, type); alertTimeout.Interval = TimeSpan.FromSeconds(5); alertTimeout.Tick += delegate { alertTimeout.Stop(); AlertStack.Children.Remove(alertBox); alertBox = null; alertTimeout = null; }; alertBox.MouseUp += delegate { alertTimeout.Stop(); AlertStack.Children.Remove(alertBox); alertBox = null; alertTimeout = null; }; AlertStack.Children.Add(alertBox); alertTimeout.Start(); }
private void CheckAndroidBackKey() { if (Input.GetKeyDown(KeyCode.Escape)) { if (_quitSingleDialog == null) { _quitSingleDialog = _dialogManager.ShowConfirmBox("是否退出游戏?", true, "退出", () => { Application.Quit(); }, true, "继续", null, true, true, true); } } }
//validate & save data and insert it into database private void save_button_Click(object sender, EventArgs e) { if (save_details_validation()) { int affected = Department_Methods.setSubjectTeacher(select_teacher_comboBox.Text, subject_nm_comboBox.Text); if (affected > 0) { AlertBox.ShowDialog("Data saved successfully", AlertBox.AlertType.success, true); loadDataGridiew(); } } }
public override bool CanBeEquipped() { var hasFreeSlots = 3 - User.Instance.CurrentHero.EquippedArtifacts.Count > 1; if (hasFreeSlots) { return(true); } AlertBox.Show("This artifact cannot be equipped right now - it requires two free Artifact slots.", MessageBoxButton.OK); return(false); }
private void IvGalleryPhotoVideoUpload_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(uploadImagePath)) { AlertBox.Create("Error", "Select file from gallery or capture image", this); return; } else { new UploadEventFileBackGround(this, EventID, uploadImagePath).Execute(); } }
private void tsLayout_Click(object sender, EventArgs e) { Utility.Save("FORM", "LOCATION", $"{ Location.X},{ Location.Y},{Width},{Height}"); dockPanel1.SaveAsXml(m_DockLayoutFile); OrderForm.SaveLayout(); MatchForm.SaveLayout(); ErrForm.SaveLayout(); CancelForm.SaveLayout(); SummaryForm.SaveLayout(); PositionForm.SaveLayout(); AlertBox.AlertWithoutReply(this, AlertBoxButton.Msg_OK, "版面儲存", "儲存完成!"); }
private void BtnSumitForgotPassword_Click(object sender, EventArgs e) { string username = txtForgotUsername.Text; HideKeyBoard.hideSoftInput(this); if (username == "") { AlertBox.Create("Error", "Please enter username!", this); return; } new callForgotPassword(this, username).Execute(); }
public override bool CanBeEquipped() { var isNoOtherBodyModificationEquipped = User.Instance.CurrentHero.EquippedArtifacts.Count(x => x.ArtifactType == ArtifactType.BodyModification) == 0; if (isNoOtherBodyModificationEquipped) { return(true); } AlertBox.Show("This artifact cannot be equipped right now - only one Body Modification can be equipped at a time.", MessageBoxButton.OK); return(false); }
private void MarkDelete4List(Hashtable Params) { IModelForm instance = PickParam(Params).GetValue <IModelForm>(ActionUtil.ActionID); if (instance != null) { StandardGrid gridList = instance.GetActived <ListModelFormProxy>().GridControl; if (gridList.SelectedRows.Count > 0) { if (AlertBox.ShowWarning("是否确认删除当前及其所有子节点数据?", instance, MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } List <DataGridViewRow> aList = new List <DataGridViewRow>(); foreach (DataGridViewRow item in gridList.SelectedRows) { List <DataGridViewRow> children = gridList.Rows.OfType <DataGridViewRow>().Where(cm => { DataRowView aRow = cm.DataBoundItem as DataRowView; if (aRow != null) { DataRowView curRow = item.DataBoundItem as DataRowView; if (curRow != null) { if (aRow.Row.Field <string>("CATEGORYID").Trim().StartsWith(curRow.Row.Field <string>("CATEGORYID").Trim())) { return(true); } } } return(false); }).ToList(); aList.AddRange(children.ToArray()); } if (aList.Count > 0) { for (int i = aList.Count - 1; i >= 0; i--) { if (!aList[i].Displayed) { continue; } instance.GetActived <ListModelFormProxy>().MarkRemoved(aList[i]); } } } } }
public override bool CanBeEquipped() { var isAnyAmmunitionEquipped = User.Instance.CurrentHero.EquippedArtifacts.Any(x => x.ArtifactType == ArtifactType.Ammunition); if (isAnyAmmunitionEquipped) { AlertBox.Show("This artifact cannot be equipped right now - it cannot be equipped with another Ammunition-type Artifact.", MessageBoxButton.OK); return(false); } return(true); }
private void button1_Click(object sender, EventArgs e) { if (Application.IsAuthenticated) { var name = this.User().GetUserName(); AlertBox.Show($"You are authenticated as {name}", alignment: ContentAlignment.MiddleCenter); } else { AlertBox.Show("You are NOT authenticated.", alignment: ContentAlignment.MiddleCenter); } }
private void BtnOK_Click(object sender, EventArgs e) { if (!_objValidationHelper.ValidateAll()) { AlertBox.ShowWarning("窗体输入项存在校检错误,请核对!", this, MessageBoxButtons.OK); return; } try { Hashtable aHT = new Hashtable(); PickParam(aHT).SetParam("DOMAINUSER", TxtAccountID.Text); PickParam(aHT).SetParam("DOMAINNAME", SuperDomain); PickParam(aHT).SetParam("PSTPWD", TxtPassword.Text); PickParam(aHT).SetParam("TYPE", (string)CBTypes.SelectedItem); PickParam(aHT).SetParam("PARENTAGENT", TxtParentAgent.Text); PickParam(aHT).SetParam(standardGrid1.DataSource); // 创建会员账户 Hashtable aTmp = new Hashtable(); MemberDBUtils.CreateMemberRecord(GetControl(), PickParam(aTmp).Merge(aHT).ParamTable); if (!PickParam(aTmp).IsOK()) { AlertBox.ShowWarning(PickParam(aTmp).GetError(), this.MyParent, MessageBoxButtons.OK); return; } // 先注册通行证、然后再添加会员账户 // 执行CRegister命令后会破坏aHT参数信息,所以在此创建一个临时aHT1用于避免原始参数集合不被破坏。 Hashtable aHT1 = new Hashtable(); if (PickParam(aHT1).Merge(aHT).SetCmd(APassport.CRegister).ExecuteCmd(new APassport()).IsOK()) { foreach (string domain in Domains.Where(cm => cm != SuperDomain)) { Hashtable aHT2 = new Hashtable(); // 绑定关联的应用域 PickParam(aHT2).Merge(aHT).SetParam("DOMAINNAME", domain); if (!PickParam(aHT2).SetCmd(APassport.CRegister).ExecuteCmd(new APassport()).IsOK()) { GetControl().WriteError(string.Format("绑定关联的应用域{0}失败!", domain)); } } } DialogResult = System.Windows.Forms.DialogResult.OK; } catch (Exception ex) { AlertBox.ShowError(ex.ToString(), this.MyParent, MessageBoxButtons.OK); } }
private void LOGIN_LOCAL() { if (TXT_KULLANICI_ADI.Text == null || TXT_KULLANICI_ADI.Text == "") { AlertBox.Show("<br> Kullanıcı Adı Giriniz! </b> ", MessageBoxIcon.Stop, alignment: System.Drawing.ContentAlignment.MiddleCenter, autoCloseDelay: 1000); return; } if (TXT_SIFRE.Text == null || TXT_SIFRE.Text == "") { AlertBox.Show("<br> Şifre Giriniz! </b> ", MessageBoxIcon.Stop, alignment: System.Drawing.ContentAlignment.MiddleCenter, autoCloseDelay: 1000); return; } using (SqlConnection SqlCon = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Connection_VISION"].ToString())) { SqlCon.Open(); using (SqlCommand Cmd = new SqlCommand("SELECT top 1 * FROM ADM_KULLANICI WHERE KODU=@KODU and AKTIF='True' ", SqlCon)) { Cmd.Parameters.AddWithValue("@KODU", TXT_KULLANICI_ADI.Text); SqlDataReader rdr = Cmd.ExecuteReader(); while (rdr.Read()) { Application.Session._KULLANICI_ID = rdr["ID"].ToString(); Application.Session._KULLANICI_MAIL_ADRESI = rdr["MAIL_ADRESI"].ToString(); Application.Session._KULLANICI_ADI_SOYADI = rdr["ADI"].ToString() + " " + rdr["SOYADI"].ToString(); Application.Session._SIRKET_KODU = rdr["SIRKET_KODU"].ToString(); Application.Session._DEPARTMANI = rdr["DEPARTMANI"].ToString(); Application.Session._GOREVI = rdr["GOREVI"].ToString(); Application.Session._UNVANI = rdr["UNVANI"].ToString(); Application.Session._KULLANICI_TURU = rdr["UNVANI"].ToString(); Application.Session._ISE_GIRIS_TARIHI = rdr["GIRIS_TARIHI"].ToString(); } using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Connection_VISION"].ToString())) { DateTime RUN_DATE = DateTime.Now; string SQL = " INSERT INTO [dbo].[XLG_HAREKET_KAYITLARI] (SIRKET_KODU,ISLEM_TARIHI,ISLEM_SAATI,YAPILAN_ISLEM,ISLEMI_YAPAN) VALUES ('" + Application.Session._SIRKET_KODU + "','" + RUN_DATE.ToString("yyyy.MM.dd") + "','" + RUN_DATE.ToString("HH:mm:ss") + "','GİRİŞ','" + Application.Session._KULLANICI_MAIL_ADRESI + "')"; SqlCommand command = new SqlCommand(SQL, conn); conn.Open(); command.CommandTimeout = 0; command.ExecuteReader(CommandBehavior.CloseConnection); conn.Close(); } rdr.Close(); } } if (Application.Session._SIRKET_KODU != null) { this.Close(); } else { { AlertBox.Show("<br> Bilgiler Doğrulanamadı! </b> ", MessageBoxIcon.Stop, alignment: System.Drawing.ContentAlignment.MiddleCenter, autoCloseDelay: 1000); return; } } }
private bool Valid() { bool flag = true; if (username_TextBox.Text == "") { if (flag) { AlertBox.ShowDialog("Please Fill Require Details...", AlertBox.AlertType.warning, true); } flag = false; username_TextBox.BackColor = Color.Pink; } if (password_TextBox.Text == "") { if (flag) { AlertBox.ShowDialog("Please Fill Require Details...", AlertBox.AlertType.warning, true); } flag = false; password_TextBox.BackColor = Color.Pink; } if (re_password_TextBox.Text == "") { if (flag) { AlertBox.ShowDialog("Please Fill Require Details...", AlertBox.AlertType.warning, true); } flag = false; re_password_TextBox.BackColor = Color.Pink; } if (password_TextBox.Text != re_password_TextBox.Text) { if (flag) { AlertBox.ShowDialog("Password Does Not Match.", AlertBox.AlertType.warning, true); flag = false; re_password_TextBox.BackColor = Color.Pink; } } if (password_TextBox.Text.Length < 6) { if (flag) { AlertBox.ShowDialog("Password Must B Of 6 Characters...", AlertBox.AlertType.warning, true); flag = false; password_TextBox.BackColor = Color.Pink; re_password_TextBox.BackColor = Color.Pink; } } return(flag); }
private void select_file_button_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog() { Filter = "Excel File|*.xls;*.xlsx;", Multiselect = false, Title = "Upload Attendance Sheet" }; if (ofd.ShowDialog() == DialogResult.OK) { file_path_textBox.Text = ofd.FileName; string filenm = ofd.FileName; bool hasSheet = false; dt_file = Attendance_Methods.ExcelToDGV(filenm, out hasSheet); attendance_dataGridView.DataSource = null; if (hasSheet) { //If Sheets r available in Excel file the it will check for valid column names & data available if (dt_file.Rows.Count > 0 && dt_file.Columns.Count > 0) { if (columnNameValidation()) { attendance_dataGridView.DataSource = dt_file; attendance_dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.ColumnHeader; attendance_dataGridView.Columns[0].Frozen = true; //After successfull checking of column names, will check the valid data in Grid View if not will give error if (!ValidatingDataGridView()) { AlertBox.ShowDialog("AttendanceSheet is not in the specified format.", AlertBox.AlertType.error, false); } } else { AlertBox.ShowDialog("We won't open :(,\r\n bcz AttendanceSheet has not the valid column name.", AlertBox.AlertType.error, false); } } else { AlertBox.ShowDialog("AttendanceSheet doesn't have any data.", AlertBox.AlertType.warning, false); } } else { AlertBox.ShowDialog("Your Excel File doesn't have Sheet, Named with 'AttendanceSheet'", AlertBox.AlertType.error, false); } } }
private void googleMap1_MapClick(object sender, Web.Ext.GoogleMaps.MapMouseEventArgs e) { if (e.Marker == null) { AlertBox.Show("You clicked location: " + e.Location.ToString(), alignment: System.Drawing.ContentAlignment.BottomRight); } else { AlertBox.Show("You clicked marker: " + e.Marker + " at location: " + e.Location.ToString(), alignment: System.Drawing.ContentAlignment.TopRight); } }
private bool valid() { if (bookid_textbox.Text == "") { bookid_textbox.BackColor = Color.Pink; AlertBox.ShowDialog("Please Enter Book ID..", AlertBox.AlertType.warning, true); return(false); } else { return(true); } }
private void tsSaveLayout_Click(object sender, EventArgs e) { Util.INI["FORMLOCATION"]["MAINLOCATION"] = $"{Location.X},{Location.Y},{Width},{Height}"; Util.DealRPTForm.SaveLayout(); Util.OrderRPTForm.SaveLayout(); Util.ErrRPTForm.SaveLayout(); Util.CancelRPTForm.SaveLayout(); Util.SummaryForm.SaveLayout(); dockPanel1.SaveAsXml(Util.DOCKLAYOUTFILE); AlertBox.AlertWithoutReply(this, AlertBoxButton.Msg_OK, "版面儲存", "儲存完成!"); }
public void Show(string text, string caption, int style) { //只提供定时器使用 int ms = 1000; string msgId = "提示消息"; MsgId = msgId; AlertBox alertBox = new AlertBox(text, caption, style); dic.Add(msgId, alertBox); alertBox.Show(); StartKiller(ms); }
private void collect_button_Click(object sender, EventArgs e) { if (valid_collect()) { loadFinanceEntity(); if (FinanceDepartment_Methods.insertFees(fe) > 0) { AlertBox.ShowDialog("Fees collected successfully", AlertBox.AlertType.success, true); dt_dataGridView = FinanceDepartment_Methods.Load_DataGridView(course_comboBox.Text, int.Parse(select_sem_numericUpDown.Value.ToString())); all_student_nm_dataGridView.DataSource = dt_dataGridView; } } }
private void MonsterButton_Click(object sender, RoutedEventArgs e) { var isNoQuestActive = User.Instance.CurrentHero.Quests.All(x => x.EndDate == default); if (isNoQuestActive) { CombatHelper.HandleUserClickOnEnemy(); } else { AlertBox.Show("Your hero is busy completing quest!\nCheck back when it's finished.", MessageBoxButton.OK); } }
public override bool CanBeEquipped() { var isAnArtifactEquipped = User.Instance.CurrentHero.EquippedArtifacts.Count > 0; var isNoInfusionEquipped = User.Instance.CurrentHero.EquippedArtifacts.All(x => x.ArtifactType != ArtifactType.Infusion); if (isAnArtifactEquipped && isNoInfusionEquipped) { return(true); } AlertBox.Show("This artifact cannot be equipped right now - it requires at least 1 other artifact to be equipped, and cannot be equipped with another Infusion.", MessageBoxButton.OK); return(false); }
private bool valid() { bool flag = true; if (bookid_textbox.Text == "") { if (flag) { AlertBox.ShowDialog("Please Enter BookID", AlertBox.AlertType.error, false); } flag = false; bookid_textbox.BackColor = Color.Pink; } if (booknm_TextBox.Text == "") { if (flag) { AlertBox.ShowDialog("Please Enter Book Name", AlertBox.AlertType.error, false); } flag = false; booknm_TextBox.BackColor = Color.Pink; } if (authornm_TextBox.Text == "") { if (flag) { AlertBox.ShowDialog("Please Enter Author Name", AlertBox.AlertType.error, false); } flag = false; authornm_TextBox.BackColor = Color.Pink; } if (publisernm_TextBox.Text == "") { if (flag) { AlertBox.ShowDialog("Please Enter Publiser Name", AlertBox.AlertType.error, false); } flag = false; publisernm_TextBox.BackColor = Color.Pink; } if (price_numericUpDown.Value == 0) { if (flag) { AlertBox.ShowDialog("Please Set Valid Price", AlertBox.AlertType.error, false); } flag = false; price_numericUpDown.BackColor = Color.Pink; } return(flag); }