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 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} 未占用"); } }
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("添加失败"); } } }
/// <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 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 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 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 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(); }
private void uiSymbolButton7_Click(object sender, EventArgs e) { UIMessageTip.ShowError("轻便消息提示框 - 错误"); }
/// <summary> /// 显示出错消息 /// </summary> /// <param name="form">窗体</param> /// <param name="text">消息文本</param> /// <param name="delay">消息停留时长(ms)。默认1秒,若要使用全局时长请设为-1</param> /// <param name="floating">是否漂浮。默认不漂浮。若要使用全局设置请设为null</param> /// <param name="point">消息窗显示位置。不指定则智能判定,当由工具栏项(ToolStripItem)弹出时,请指定该参数或使用接收控件的重载</param> /// <param name="centerByPoint">是否以point参数为中心进行呈现。为false则是在其附近呈现</param> public static void ShowErrorTip(this Form form, string text = null, int delay = 1000, bool?floating = null, Point?point = null, bool centerByPoint = false) => UIMessageTip.ShowError(text, delay, floating, point, centerByPoint);
/// <summary> /// 在指定控件附近显示出错消息 /// </summary> /// <param name="form">窗体</param> /// <param name="controlOrItem">控件或工具栏项</param> /// <param name="text">消息文本</param> /// <param name="delay">消息停留时长(ms)。默认1秒,若要使用全局时长请设为-1</param> /// <param name="floating">是否漂浮。默认不漂浮。若要使用全局设置请设为null</param> /// <param name="centerInControl">是否在控件中央显示,不指定则自动判断</param> public static void ShowErrorTip(this Form form, Component controlOrItem, string text = null, int delay = 1000, bool?floating = null, bool?centerInControl = null) => UIMessageTip.ShowError(controlOrItem, text, delay, floating, centerInControl);