private void uiSymbolButton8_Click_1(object sender, EventArgs e) { if (bookid.Text.Trim() == "" || address.Text.Trim() == "" || state.Text.Trim() == "") { UIMessageBox.ShowError("请填写完整信息"); } else { try { string sql = "insert into bookcase values('" + bookid.Text.Trim() + "','" + address.Text.Trim() + "','" + state.Text.Trim() + "')"; if (SqlHelper.ExecuteNonQuery(sql) > 0) { UIMessageBox.ShowSuccess("添加成功!"); caseid.Text = ""; bookid.Text = ""; address.Text = ""; state.Text = ""; SqlHelper.setGDV("select caseid 编号, id 书架编号, address 藏书地址,state 借阅状态 from bookcase", uiDataGridView7); } else { UIMessageTip.ShowError("添加失败"); } } catch { UIMessageBox.ShowError("添加失败"); } } }
private void btnCheckPort_Click(object sender, EventArgs e) { var port = this.tbPort.Text; if (port.IsNullOrWhiteSpace()) { UIMessageTip.ShowError("端口号为空", 1000, true); return; } if (!port.IsNumeric()) { UIMessageTip.ShowError("端口号只能为数字", 1000, true); return; } if (PortHelper.PortInUse(Convert.ToInt32(port))) { this.ShowWarningDialog($"{port}端口号已被占用"); } else { this.ShowSuccessTip($"端口号:{port} 未占用"); } }
/// <summary> /// Test /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnConnTest_Click(object sender, EventArgs e) { //var config = new TemplateServiceConfiguration(); //config.CompilerServiceFactory = new RazorEngine.Roslyn.RoslynCompilerServiceFactory(); //using (var service = RazorEngineService.Create(config)) //{ // string template = "@Model.Name"; // var model0 = new { Name = "Matt" }; // string result0 = service.RunCompile(template, "htmlRawTemplate0", null, model0); //} var model = GetLVSelectConfigModel(); var connTypeValue = Convert.ToInt32(model.ConnType); if (model.ConnString.IsNullOrEmpty() || model.ConnName.IsNullOrEmpty()) { this.ShowWarningDialog("连接字符串或连接名称不可为空"); return; } var result = ConnTestUtil.ConnTest(connTypeValue, model.ConnString); if (!result) { UIMessageTip.ShowError("测试失败", 1000, true); } else { UIMessageTip.ShowOk("测试成功", 1000, true); } }
private void btnCancel_Click(object sender, EventArgs e) { if (dgvRoomSell.SelectedRows.Count > 0) { if (UIMessageDialog.ShowMessageDialog("你确定要删除该消费记录吗?", UILocalize.WarningTitle, true, Style)) { string time = dgvRoomSell.SelectedRows[0].Cells["clSpendTime"].Value.ToString(); string name = dgvRoomSell.SelectedRows[0].Cells["clSpendName"].Value.ToString(); string price = dgvRoomSell.SelectedRows[0].Cells["clSpendPrice"].Value.ToString(); SellThing s = new SellService().SelectSellThingByNameAndPrice(name, price); decimal num = Convert.ToDecimal(dgvRoomSell.SelectedRows[0].Cells["clSpendAmount"].Value.ToString()); string Stock = (s.Stock + num).ToString(); if (new SellService().DeleteSellThing(txtRoomNo.Text, time) == true) { bool n = new SellService().UpdateSellThing(Stock, s.SellNo); UIMessageTip.ShowOk("撤销成功!", 1000); LoadSpendInfoByRoomNo(txtRoomNo.Text); LoadSellThingInfo(); } } else { UIMessageTip.ShowError("操作取消!", 1000); } } else { MessageBox.Show("请选择要删除的消费记录!", "提示信息"); } }
private void Save_Click(object sender, EventArgs e) { if (uiRadioButton1.Checked && !uiRadioButton2.Checked && !uiRadioButton3.Checked) { AddUpdateAppSettings("Code_rate_control_mode_selection", "1"); } else if (!uiRadioButton1.Checked && uiRadioButton2.Checked && !uiRadioButton3.Checked) { AddUpdateAppSettings("Code_rate_control_mode_selection", "2"); } else if (!uiRadioButton1.Checked && !uiRadioButton2.Checked && uiRadioButton3.Checked) { AddUpdateAppSettings("Code_rate_control_mode_selection", "3"); } else { ShowErrorDialog(@"正常情况看不到这个,出现该弹窗请带上复现方法到GitHub提issue"); } AddUpdateAppSettings("I", IBox.Text); AddUpdateAppSettings("P", PBox.Text); AddUpdateAppSettings("B", BBox.Text); AddUpdateAppSettings("CBR", CBRBox.Text); AddUpdateAppSettings("VBR", VBRBox.Text); AddUpdateAppSettings("Raws_audiobit", AudioBox.Text); UIMessageTip.ShowOk("保存成功"); }
/// <summary> /// 初始化控制器按钮 /// </summary> void InitButton() { foreach (var btnName in Main._Setting.ControllerButton) { var control = this.GetControl(btnName); if (control is UISymbolButton) { if (control.Name == "btnScreenshot") { control.Click += (sender, e) => { if (ADB.Screenshot()) { UIMessageTip.ShowOk(this, "截图成功!图片保存在桌面FreeControl Screenshot文件夹中。", 2000, false); } }; } else { var keyCode = (KeyCode)Enum.Parse(typeof(KeyCode), btnName.Remove(0, 3)); control.Click += (sender, e) => ADB.ExecuteShell(ADB.GetCommand(keyCode)); } flowPanel.AddControl(control); } } }
public void IAPSucessHandle(object e, Hashtable hash) { var purchID = (string)hash["PurchID"]; var chargeRecord = Tables.TableReader.Recharge.GetRecord(purchID); UIMessageTip.ShowMessageTip(Tables.StrDictionary.GetFormatStr(2023, chargeRecord.Num)); }
private void NotifyUser(Control control, string information) { Point controlLoc = this.PointToScreen(control.Location); controlLoc.X = controlLoc.X + (control.Width / 2) + 10; controlLoc.Y += 60; UIMessageTip.ShowOk(information, point: controlLoc); }
public static void ShowExpTip(int exp) { GTWindowManager.Instance.OpenWindow(EWindowID.UIMessageTip); UIMessageTip dialog = (UIMessageTip)GTWindowManager.Instance.GetWindow(EWindowID.UIMessageTip); string format = GetText("经验+{0}"); dialog.ShowExp(GTTools.Format(format, exp)); }
public static void ShowBoxTips(string currInfo, float timeVis, float duration) { GameObject obj = GameMethod.CreateWindow(GameConstDefine.MessageTipUI, new Vector3(0, -1, 0), GameMethod.GetUiCamera.transform); UIMessageTip uims = obj.GetComponent <UIMessageTip>(); uims.SetCapionInfo(currInfo, timeVis); UICommonMethod.TweenPositionBegin(obj, duration, Vector3.zero, UITweener.Style.Once); }
public static void ShowTip(string key) { string value = GetText(key); GTWindowManager.Instance.OpenWindow(EWindowID.UIMessageTip); UIMessageTip dialog = (UIMessageTip)GTWindowManager.Instance.GetWindow(EWindowID.UIMessageTip); dialog.ShowWarning(value); }
private void uiSymbolButton13_Click(object sender, EventArgs e) { string dir = ""; if (DirEx.SelectDirEx("扩展打开文件夹", ref dir)) { UIMessageTip.ShowOk(dir); } }
/// <summary> /// 显示提示消息 /// </summary> /// <param name="content"></param> /// <param name="delay"></param> /// <param name="isFloat"></param> private void ShowMessage(string content, int delay = 1500, bool isFloat = true) { Action action = () => { UIMessageTip.Show(this, content, null, delay, isFloat); }; Invoke(action); }
private void picExtend_Click(object sender, EventArgs e) { //pnlMID.Controls.Clear(); UIMessageTip.ShowError("界面维护,请稍后重试"); return; //FrmExtendOption frm = new FrmExtendOption(); //frm.TopLevel = false; //FrmExtendOption frm1 = new FrmExtendOption(); //frm1.TopLevel = false; //pnlMID.Controls.Add(frm1); //frm1.Show(); }
private void uiSymbolButton10_Click(object sender, EventArgs e) { FLogin frm = new FLogin(); frm.ShowDialog(); if (frm.IsLogin) { UIMessageTip.ShowOk("登录成功"); } frm.Dispose(); }
private void btnDbOk_Click(object sender, EventArgs e) { var connString = this.tbConnString.Text; var dbName = this.tbDbName.Text; var dbPath = this.tbDbPath.Text; var savePath = this.tbSavePath.Text; if (connString.IsNullOrWhiteSpace()) { this.ShowWarningDialog("没有设置连接字符串"); return; } if (dbName.IsNullOrWhiteSpace()) { this.ShowWarningDialog("数据库名不可为空"); return; } if (dbPath.IsNullOrWhiteSpace()) { this.ShowWarningDialog("数据库文件不可为空"); return; } if (!File.Exists(dbPath)) { this.ShowWarningDialog("数据库文件不存在"); return; } if (savePath.IsNullOrWhiteSpace()) { this.ShowWarningDialog("保存目录不可为空"); return; } if (!Directory.Exists(savePath)) { this.ShowWarningDialog("保存目录不存在"); return; } var dal = GetDal(this.tbConnString.Text); var dbNameIsExist = dal.IsExistDb(dbName); if (dbNameIsExist) { this.ShowWarningDialog($"数据库:{dbName} 已存在"); return; } dal.RestoreDb(dbName, dbPath, savePath); UIMessageTip.ShowOk("创建成功", 2000, true); }
public void BtnAdd(int stepValue) { int resValue = Value + _StepValue; SetValue(resValue); _NumModifyEvent.Invoke(); if (resValue == _MaxValue) { UIMessageTip.ShowMessageTip(23300); } }
public void BtnDec(int stepValue) { int resValue = Value - _StepValue; SetValue(resValue); _NumModifyEvent.Invoke(); //SetNumBtnState(); if (resValue == _MinValue) { UIMessageTip.ShowMessageTip(23300); } }
private void uiSymbolButton3_Click(object sender, EventArgs e) { UILoginForm frm = new UILoginForm(); frm.Text = "SunnyUI.Net Login Form"; frm.SubText = "SunnyUI.Net V2.2.5"; frm.OnLogin += Frm_OnLogin; frm.LoginImage = UILoginForm.UILoginImage.Login2; frm.ShowDialog(); if (frm.IsLogin) { UIMessageTip.ShowOk("登录成功"); } frm.Dispose(); }
private void picExtend_Click(object sender, EventArgs e) { picRoom.BackgroundImage = Resources.预订管理_aa; picCustomer.BackgroundImage = Resources.用户管理_ib; picCommodity.BackgroundImage = Resources.商品消费_ia; //picExtend.BackgroundImage = Resources.扩展功能_ia; //pnlMID.Controls.Clear(); UIMessageTip.ShowError("界面维护,请稍后重试"); return; //FrmExtendOption frm = new FrmExtendOption(); //frm.TopLevel = false; //FrmExtendOption frm1 = new FrmExtendOption(); //frm1.TopLevel = false; //pnlMID.Controls.Add(frm1); //frm1.Show(); }
private void NotifyProfile(Control control, string information, bool isOk) { Point controlLoc = this.PointToScreen(control.Location); controlLoc.X = controlLoc.X + (control.Width / 2) + 10; controlLoc.Y += 160; if (isOk) { UIMessageTip.ShowOk(information, point: controlLoc); } else { UIMessageTip.ShowWarning(information, point: controlLoc); } }
public void OnBtnOk() { if (_InputBoardNum >= _MaxValue) { UIMessageTip.ShowMessageTip(23300); _InputBoardNum = _MaxValue; } if (_InputBoardNum <= _MinValue) { UIMessageTip.ShowMessageTip(23300); _InputBoardNum = _MinValue; } SetValue(_InputBoardNum); _NumModifyEvent.Invoke(); }
private void btnTest_Click(object sender, EventArgs e) { if (this.tbConnString.Text.IsNullOrWhiteSpace()) { this.ShowWarningDialog("没有设置连接字符串"); return; } var dal = GetDal(this.tbConnString.Text); var result = dal.TestConnection(); if (!result) { UIMessageTip.ShowError("测试失败", 1000, true); } else { UIMessageTip.ShowOk("测试成功", 1000, true); } }
private void btnSiteUse_Click(object sender, EventArgs e) { var siteName = this.tbSiteName.Text; if (siteName.IsNullOrWhiteSpace()) { UIMessageTip.ShowError("应用名为空", 1000, true); return; } if (iisManager.IsExistSiteName(siteName)) { this.ShowWarningDialog($"应用名:{siteName} 已被使用"); } else { this.ShowSuccessTip($"应用名:{siteName} 未使用"); } }
private void btnPoolNameUse_Click(object sender, EventArgs e) { var poolName = this.tbPoolName.Text; if (poolName.IsNullOrWhiteSpace()) { UIMessageTip.ShowError("程序池名为空", 1000, true); return; } if (iisManager.IsExistPoolName(poolName)) { this.ShowWarningDialog($"名称:{poolName}已被使用"); } else { this.ShowSuccessTip($"名称:{poolName} 未使用"); } }
private void uiSymbolButton3_Click(object sender, EventArgs e) { UILoginForm frm = new UILoginForm { ShowInTaskbar = true, Text = "Login", Title = "SunnyUI.Net Login Form", SubText = Version }; frm.OnLogin += Frm_OnLogin; frm.LoginImage = UILoginForm.UILoginImage.Login2; frm.ShowDialog(); if (frm.IsLogin) { UIMessageTip.ShowOk("登录成功"); } frm.Dispose(); }
private void btnConnSave_Click(object sender, EventArgs e) { ConfigModel model = GetLVSelectConfigModel(); if (model.ConnType.IsNullOrEmpty() || model.ConnString.IsNullOrEmpty() || model.ConnName.IsNullOrEmpty()) { UIMessageTip.ShowError("没有输入连接字符串、连接名或数据库类型", 1000, true); return; } if (model.Guid.IsNullOrEmpty()) { model.Guid = Guid.NewGuid().ToString(); jsonUtil.Add(model); } else { jsonUtil.Edit(model); } InitListView(); }
public bool DecMoney(string id, int value) { var moneyInfo = GetMoneyInfo(id); if (moneyInfo == null) { var commonitem = TableReader.CommonItem.GetRecord(id); UIMessageTip.ShowMessageTip(StrDictionary.GetFormatStr(2001, StrDictionary.GetFormatStr(commonitem.NameStrDict))); return(false); } else if (moneyInfo.Value < value) { var commonitem = TableReader.CommonItem.GetRecord(id); UIMessageTip.ShowMessageTip(StrDictionary.GetFormatStr(2001, StrDictionary.GetFormatStr(commonitem.NameStrDict))); return(false); } moneyInfo.Value -= value; SaveClass(true); GameCore.Instance.EventController.PushEvent(EVENT_TYPE.EVENT_LOGIC_REFRESH_MONEY, this, null); return(true); }
private void btnSave_Click(object sender, EventArgs e) { try { foreach (DataGridViewRow row in this.dgv_config.Rows) { var key = row.Cells["key"].Value?.ToString(); var value = row.Cells["value"].Value?.ToString(); if (ConfigUtil.GetAppSettingValue(key, configPath: _configPath).IsNullOrWhiteSpace()) { ConfigUtil.SetConnectionString(key, value, null, configPath: _configPath); } else { ConfigUtil.SetAppSettingValue(key, value, _configPath); } } UIMessageTip.ShowOk("编辑成功", 2000, true); } catch (Exception ex) { this.ShowWarningDialog("编辑失败"); } }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text.Trim().Equals("") || textBox2.Text.Trim().Equals("")) { UIMessageTip.Show("信息不能为空"); } else { if (comboBox1.SelectedIndex == 0) { string no = textBox1.Text.Trim(); string name = textBox2.Text.Trim(); try { SqlConnection conn = new SqlConnection(con); string sql = "select mno,mpwd from manager where mno='" + no + "'and mpwd='" + name + "'"; conn.Open(); SqlCommand comm = new SqlCommand(sql, conn); SqlDataReader sqlDataReader = comm.ExecuteReader(); if (sqlDataReader.HasRows) { UIMessageBox.Show("登陆成功"); string n = textBox1.Text; this.Hide(); manabook man = new manabook(n); man.Show(); } else { MessageBox.Show("登录失败"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { string no = textBox1.Text.Trim(); string name = textBox2.Text.Trim(); try { SqlConnection conn = new SqlConnection(con); string sql = "select sno,pwd from student where sno='" + no + "'and pwd='" + name + "'"; conn.Open(); SqlCommand comm = new SqlCommand(sql, conn); SqlDataReader sqlDataReader = comm.ExecuteReader(); if (sqlDataReader.HasRows) { MessageBox.Show("登陆成功"); this.Hide(); new readbook().Show(); } else { MessageBox.Show("登录失败"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }