private void ButOK_Click(object sender, EventArgs e) { string RoList = comboBox1.Text.Trim() + Ro[x].Trim(); SaveRenewWaysToRegistry(DESEncrypt.DesEncrypt(RoList)); FrmMessageBox frm = new FrmMessageBox("已完成授权,请联系管理员进行获取授权文件授权密钥为!" + comboBox1.Text.Trim() + "\t" + x.ToString(), "系统提示", MessageBoxStyle.right); frm.ShowDialog(); }
public static DialogResult MessageBox(string title, string message, bool use_btn1, DialogResult btn1_result_type, bool use_btn2, DialogResult btn2_result_type, bool use_btn3, DialogResult btn3_result_type, string btn1_text, string btn2_text, string btn3_text, int default_button) { DialogResult result; using (var fMsgBox = new FrmMessageBox(title, Environment.NewLine + Environment.NewLine + message, use_btn1, btn1_result_type, use_btn2, btn2_result_type, use_btn3, btn3_result_type, btn1_text, btn2_text, btn3_text, default_button)) { result = fMsgBox.ShowDialog(); } return(result); }
public static void ShowMessageBox(string module, string troubleshooting, Exception ex) { Log4Helper.Write(module, ex); //MessageBox.Show(strMsg, Constants.MSG_SYSTEMERROR, MessageBoxButtons.OK, MessageBoxIcon.Error); FrmMessageBox frmMsg = new FrmMessageBox(); frmMsg.Module = module; frmMsg.Exception = ex; frmMsg.TroubleShooting = troubleshooting; frmMsg.ShowDialog(); }
private void label3_Click(object sender, EventArgs e) { if (pageindex == 1) { FrmMessageBox frm = new FrmMessageBox("当前是第一页", "提示", MessageBoxStyle.right); frm.ShowDialog(); // MessageBox.Show("当前是第一页"); } if (pageindex > 1) { pageindex--; } DataFood(Foodlist); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FrmMessageBox frm; string fileName = Application.StartupPath + "\\authorize.txt"; // if (!File.Exists(fileName)) { frm = new FrmMessageBox("尚未授权!", "系统提示", MessageBoxStyle.error); frm.ShowDialog(); return; } FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(fs); string txt = sr.ReadToEnd(); sr.Close(); fs.Close(); //string str1 = CommonInfo.DESEncrypt.DesDecrypt(txt); // str1 = CommonInfo.MD5Hashing.MD5Decrypt(str1, "hbsrfid1"); if (string.IsNullOrWhiteSpace(txt)) { frm = new FrmMessageBox("该设备没有授权!", "系统提示", MessageBoxStyle.error); frm.ShowDialog(); return; } if (!IsRegeditItemExist("software", "DouLaiDian"))//不存在该注册表项 { frm = new FrmMessageBox("该设备没有授权!", "系统提示", MessageBoxStyle.error); frm.ShowDialog(); return; } string registry = ReadFromRegistry(); if (DESEncrypt.DesDecrypt(txt.Trim()).Equals(DESEncrypt.DesDecrypt(registry.Trim()))) { Application.Run(new WelCome()); } else { frm = new FrmMessageBox("该设备没有授权!", "系统提示", MessageBoxStyle.error); frm.ShowDialog(); return; } }
public static void ShowMessageBox(string module, string troubleshooting, Exception ex) { //ex.TargetSite() //string strMsg = ""; //strMsg = "Message:" + ex.Message + "\r\n"; //strMsg += "Source:" + ex.Source + "\r\n"; //strMsg += "TargetSite:" + ex.TargetSite + "\r\n"; //strMsg += "StackTrace:" + ex.StackTrace + "\r\n"; //MessageBox.Show(strMsg, Constants.MSG_SYSTEMERROR, MessageBoxButtons.OK, MessageBoxIcon.Error); Log4Helper.Write(module, ex); FrmMessageBox frmMsg = new FrmMessageBox(); frmMsg.Module = module; frmMsg.Exception = ex; frmMsg.TroubleShooting = troubleshooting; frmMsg.ShowDialog(); }
public static void ShowAlert(string Title, string Message, TypeMessage typeMessage) { try { FrmMessageBox instance = new FrmMessageBox { Title = Title, Message = Message, typeMessage = typeMessage }; instance.ShowDialog(); instance.Dispose(); } catch (Exception ex) { throw ex; } }
public static DialogResult ShowAlertRequest(string Title, string Message) { try { FrmMessageBox instance = new FrmMessageBox { Title = Title, Message = Message, typeMessage = TypeMessage.confirmacion }; instance.ShowDialog(); instance.Dispose(); return(instance.DialogResult); } catch (Exception ex) { throw ex; } }
void DataFood(List <FoodList> Foodlist) { label5.Text = (pageindex).ToString(); //分页处理 Foodlist = Foodlist.Skip((pageindex - 1) * pagesize).Take(pagesize).ToList(); int q = Foodlist.Count(); int hidd = 8 - q; //shopCars[q].Hide(); try { for (int i = 0; i <= Foodlist.Count() - 1; i++) { shopCars[i].Show(); shopCars[i].label2.Text = Foodlist[i].Price.ToString(); shopCars[i].label1.Text = Foodlist[i].FoodName.ToString(); shopCars[i].label4.Text = Foodlist[i].FoodID.ToString(); //// = O_Image; try { shopCars[i].pictureBox1.Load(Foodlist[i].imageUrl); } catch { } } for (; q <= 7; q++) { shopCars[q].Hide(); } } catch { FrmMessageBox frm = new FrmMessageBox("请检测服务器开启情况", "提示", MessageBoxStyle.error); frm.ShowDialog(); } }
private void Form1_Load(object sender, EventArgs e) { CommonInfo.FrmMessageBox frm = new FrmMessageBox("是否选择共用模式", "模式选择", MessageBoxStyle.question); DialogResult A = frm.ShowDialog(); if (A == DialogResult.Cancel) { buttonX1.Show(); if (!File.Exists("Table.txt")) { WelCome.HideInputPanel(); WelCome.ShowInputPanel(); string result;// = Microsoft.VisualBasic.Interaction.InputBox("请输入餐桌号", "锁定餐桌", "", this.Left, this.Top); // WriteStart(result); Boolean fl = true; while (fl) { result = Microsoft.VisualBasic.Interaction.InputBox("请输入餐桌号", "锁定餐桌", "", this.Left, this.Top); if (string.IsNullOrEmpty(result)) { var B = MessageBox.Show("请重新输入,不可为空值", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (DialogResult.No == B) { fl = false; } } else { var i = mDF.FoodTable.Where(m => m.TableName.Equals(result)); if (i.Count() > 0) { CommonInfo.FrmMessageBox fm = new CommonInfo.FrmMessageBox("添加成功", "管理员提示:", MessageBoxStyle.right); fm.ShowDialog(); WriteStart(result); WelCome.HideInputPanel(); fl = false; } else { CommonInfo.FrmMessageBox fm = new CommonInfo.FrmMessageBox("不存在该餐桌", "管理员提示:", MessageBoxStyle.question); fm.ShowDialog(); } } } } List <String> Ro = new List <string>(File.ReadAllLines("Table.txt", Encoding.UTF8)); tablenum = Ro[0]; if (string.IsNullOrEmpty(tablenum)) { CommonInfo.FrmMessageBox fm = new CommonInfo.FrmMessageBox("餐桌绑定失败", "管理员提示:", MessageBoxStyle.right); fm.ShowDialog(); } } else { buttonX1.Hide(); } textBox2.Hide(); button7.Hide(); comboBox1.DataSource = mDF.FoodType.ToList(); comboBox1.DisplayMember = "FoodTypeName"; //comboBox1.ValueMember = "FoodTypeID"; shopCars.Add(shopCar1); shopCars.Add(shopCar2); shopCars.Add(shopCar3); shopCars.Add(shopCar4); shopCars.Add(shopCar5); shopCars.Add(shopCar6); shopCars.Add(shopCar7); shopCars.Add(shopCar8); Load_FoodList(); }
private void button1_Click(object sender, EventArgs e) { this.TopMost = false; if (Form1.listsorder.Count() == 0) { MessageBox.Show("当前数据为空"); return; } WelCome.HideInputPanel(); WelCome.ShowInputPanel(); string result = Microsoft.VisualBasic.Interaction.InputBox("请输入手机号", "手机号", "", this.Left, this.Top); if (!IsPhone(result)) { WelCome.HideInputPanel(); FrmMessageBox frm = new FrmMessageBox("手机号错误", "请正确输入", MessageBoxStyle.error); frm.ShowDialog(); this.TopMost = true; return; } WelCome.HideInputPanel(); this.TopMost = true; Order order = new Order(); order.Date = DateTime.Now; order.ISOut = false; if (!String.IsNullOrEmpty(Form1.tablenum)) { order.phone = result + "餐桌号:" + Form1.tablenum; } else { order.phone = result; } order.TotalParse = TotalPrice(); db.Order.Add(order); db.SaveChanges(); int orderid = order.OrderID; _ = new List <OrderList>(); foreach (var i in Form1.listsorder) { OrderList ord = new OrderList(); ord.OrderID = orderid; ord.foodname = i.foodname; ord.num = i.num; ord.price = i.price; db.OrderList.Add(ord); db.SaveChanges(); } dataGridView1.DataSource = null; Form1.listsorder.Clear(); FrmMessageBox frm1; this.TopMost = false; if (!String.IsNullOrEmpty(Form1.tablenum)) { frm1 = new FrmMessageBox("请熟记订单编号" + ":" + orderid, "提示", MessageBoxStyle.right); } else { frm1 = new FrmMessageBox("请熟记订单编号" + ":" + orderid + ";请到前台申请座位", "提示", MessageBoxStyle.right);; } frm1.ShowDialog(); this.TopMost = true; dataGridView1.DataSource = Form1.listsorder.ToList(); textBoxLabel1.Text = "总计:" + TotalPrice().ToString() + "元"; }
public static void ShowMessageBox(string module, string troubleshooting, Exception ex) { LogHelper.Write(module, ex); //MessageBox.Show(strMsg, Constants.MSG_SYSTEMERROR, MessageBoxButtons.OK, MessageBoxIcon.Error); FrmMessageBox frmMsg = new FrmMessageBox(); frmMsg.Module = module; frmMsg.Exception = ex; frmMsg.TroubleShooting = troubleshooting; frmMsg.ShowDialog(); }