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 uiButton2_Click_1(object sender, EventArgs e) { List <RemoteMinerStatus> selectedMiner = new List <RemoteMinerStatus>(); for (int i = 0; i < MinerStatusTable.Rows.Count; i++) { if (MinerStatusTable.Rows[i].Cells[2].Value == null) { continue; } if (MinerStatusTable.Rows[i].Cells[2].Value.ToString() == "True") { for (int j = 0; j < MinerStatusLoad.remoteMinerStatusList.Count; j++) { if (MinerStatusLoad.remoteMinerStatusList[i].IP == MinerStatusTable.Rows[i].Cells[12].Value.ToString()) { selectedMiner.Add(MinerStatusLoad.remoteMinerStatusList[i]); } } } } if (selectedMiner.Count <= 0) { UIMessageBox.ShowError("请选择矿机"); return; } overClockForm overClockForm = new overClockForm(selectedMiner); overClockForm.ShowDialog(); }
private void uiButton9_Click(object sender, EventArgs e) { if (!checkTableSelected(MinerStatusTable)) { UIMessageBox.ShowError("请选择矿机"); return; } RemoteOtherOptions remoteOtherOptions = new RemoteOtherOptions(); remoteOtherOptions.function = "otherOption"; remoteOtherOptions.autoLogin = loginStart.Checked; remoteOtherOptions.autoMining = autoMining.Checked; remoteOtherOptions.autoMiningTime = autoMiningTime.Text; remoteOtherOptions.autoOv = autoOverclock.Checked; string msg = JsonConvert.SerializeObject(remoteOtherOptions); var i = 0; for (; i < MinerStatusTable.Rows.Count; i++) { if (MinerStatusTable.Rows[i].Cells[2].Value == null) { continue; } if (MinerStatusTable.Rows[i].Cells[2].Value.ToString() == "True") { UDPHelper.Send(msg, MinerStatusTable.Rows[i].Cells[12].Value.ToString()); UIMessageBox.Show("设置完成", "提示"); return; } } }
private void btnAddSellThing_Click(object sender, EventArgs e) { st = new SellThing() { SellNo = txtSellNo.Text, SellName = txtSellName.Text, SellPrice = Convert.ToDecimal(txtSellPrice.Text), format = Convert.ToString(txtformat.Text), Stock = Convert.ToInt32(txtStock.Text), datains_usr = AdminInfo.Account, datains_date = DateTime.Now }; if (CheckInput(st)) { new SellService().InsertSellThing(st); MessageBox.Show("添加商品成功"); dgvSellthing.DataSource = new SellService().SelectSellThingAll(); string SellId = new CounterHelper().GetNewId("SellId"); txtSellNo.Text = SellId; } else { UIMessageBox.ShowError("信息不完整,请检查!"); return; } }
public static void startMiner(UIRichTextBox LogOutput, ref UIPanel panel) { try { Process minerProcess = new Process(); minerProcess.StartInfo.FileName = Application.StartupPath + "\\miner\\" + minerBigName + "\\" + minerSmallName + ".exe"; minerProcess.StartInfo.Arguments = string.Format(getArguments(), miningPool, wallet, worker, argu); LogOutput.AppendText("[" + DateTime.Now.ToLocalTime().ToString() + "] 开始挖矿,启动参数:" + minerProcess.StartInfo.Arguments + ",若长时间无反应,请勾选显示原版内核查看错误提示\n"); minerProcess.StartInfo.CreateNoWindow = false; minerProcess.StartInfo.UseShellExecute = false; if (minerSmallName.ToLower().Contains("nb")) { #if DEBUG LogOutput.AppendText("nbminer"); #endif minerProcess.StartInfo.EnvironmentVariables.Remove("NBDEV"); minerProcess.StartInfo.EnvironmentVariables.Add("NBDEV", "#@@@TSAmlU3LTYLdf9NFpnQbkIpKVFex7gJvUmzC01xGSyw="); } minerProcess.Start(); fr = new showMinerWindow(panel, ""); IntPtr NbminerHandle = fr.Start(minerProcess); fr.Application_Idle(null, null); StringBuilder 参数 = new StringBuilder(); 参数.Append("\""); 参数.Append(minerProcess.StartInfo.FileName); 参数.Append("\" "); 参数.Append(minerProcess.StartInfo.Arguments); 生成原版bat(参数.ToString()); } catch (Exception ex) { UIMessageBox.ShowError("错误:" + ex.ToString()); } }
private void uiButton8_Click(object sender, EventArgs e) { if (!checkTableSelected(MinerStatusTable)) { UIMessageBox.ShowError("请选择矿机"); return; } RemoteReboot remoteReboot = new RemoteReboot(); remoteReboot.function = "setreboot"; remoteReboot.hourReboot = timeRestart.Text; remoteReboot.hashrateReboot = lowHashrateRestart.Text; string msg = JsonConvert.SerializeObject(remoteReboot); var i = 0; for (; i < MinerStatusTable.Rows.Count; i++) { if (MinerStatusTable.Rows[i].Cells[2].Value == null) { continue; } if (MinerStatusTable.Rows[i].Cells[2].Value.ToString() == "True") { UDPHelper.Send(msg, MinerStatusTable.Rows[i].Cells[12].Value.ToString()); UIMessageBox.Show("设置完成", "提示"); return; } } }
private void uiSymbolButton1_Click(object sender, EventArgs e) { string pwd = SqlHelper.MD5Hash(uiTextBox2.Text); string flag = uiRadioButton1.Checked ? "admin" : "users"; string sql = "select * from " + flag + " where id = '" + uiTextBox1.Text + "' and pwd = '" + pwd + "'"; object result = SqlHelper.ExecuteScalar(sql); if (result != null) { global.role = result.ToString(); global.username = uiTextBox1.Text; UIMessageBox.ShowSuccess("登录成功"); this.Hide(); if (flag == "admin") { new ManagerMain().Show(); } else if (flag == "users") { new ReaderMain().Show(); } } else { UIMessageBox.ShowError("用户名或密码错误"); } }
private void uiButton7_Click(object sender, EventArgs e) { if (!MinerOptions.updateMiner(MinerStatusTable)) { UIMessageBox.ShowError("请选择矿机"); } else { UIMessageBox.Show("更新完成"); } }
private void uiButton11_Click(object sender, EventArgs e) { if (!MinerOptions.amdOffCalc(MinerStatusTable)) { UIMessageBox.ShowError("请选择矿机"); } else { UIMessageBox.Show("设置完成"); } }
private void changeCoin_Load(object sender, EventArgs e) { if (!checkTableSelected(MinerStatusTable)) { UIMessageBox.ShowError("请选择矿机"); this.Close(); } getMiningInfo(); loadCoinIni(ref SelectCoin); SelectCoin.SelectedIndex = 0; SelectMiner.SelectedIndex = 0; SelectMiningPool.SelectedIndex = 0; }
private void uiButton5_Click(object sender, EventArgs e) { if (UIMessageBox.ShowAsk("你真的要关机吗")) { if (!MinerOptions.shutdownMiner(MinerStatusTable)) { UIMessageBox.ShowError("请选择矿机"); } else { UIMessageBox.Show("关机完成"); } } }
private void uiButton6_Click(object sender, EventArgs e) { if (UIMessageBox.ShowAsk("你真的要重启吗")) { if (!MinerOptions.rebootMiner(MinerStatusTable)) { UIMessageBox.ShowError("请选择矿机"); } else { UIMessageBox.Show("重启完成"); } } }
private void uiSymbolButton12_Click_1(object sender, EventArgs e) { string id = uiDataGridView7[0, uiDataGridView7.CurrentCell.RowIndex].Value.ToString(); string sql = "update bookcase set id = '" + bookid.Text + "',address = '" + address.Text.Trim() + "',state='" + state.Text.Trim() + "' where caseid = '" + id + "'"; try { SqlHelper.ExecuteNonQuery(sql); UIMessageBox.ShowSuccess("修改成功"); } catch { UIMessageBox.ShowError("不存在该书籍"); } SqlHelper.setGDV("select caseid 编号, id 书架编号, address 藏书地址,state 借阅状态 from bookcase", uiDataGridView7); }
private void btnUpd_Click(object sender, EventArgs e) { bool dr = UIMessageBox.Show("是否确认修改员工信息?", "修改提醒", UIStyle.Green, UIMessageBoxButtons.OKCancel); if (dr == true) { string NewTel = Md5LockedUtil.MD5Encrypt32(WorkerTel.Text.ToString()); #region 员工信息代码块 Worker worker = new Worker { WorkerId = WorkerNo.Text.Trim(), WorkerName = WorkerName.Text.Trim(), WorkerNation = cbWorkerNation.SelectedValue == null ? "N-00001" : cbWorkerNation.SelectedValue.ToString(), WorkerTel = NewTel, WorkerAddress = txtAddress.Text, WorkerFace = cboWorkerFace.Text, WorkerEducation = cboEducation.SelectedValue.ToString() == null ? "E-00001" : cboEducation.SelectedValue.ToString(), datachg_usr = AdminInfo.Account, datachg_date = DateTime.Now }; bool i = new WorkerService().UpdateWorker(worker); if (i == true) { UIMessageBox.ShowSuccess("信息修改成功!"); return; } else { UIMessageBox.ShowError("服务器繁忙!"); return; } #endregion } else { UIMessageBox.ShowWarning("修改操作已取消!"); return; } }
private void uiButton1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(InputMiningPool.Text)) { UIMessageBox.ShowError("请输入矿池地址"); return; } if (string.IsNullOrEmpty(InputWallet.Text)) { UIMessageBox.ShowError("请输入钱包地址"); return; } changeCoinClass changeCoinClass = new changeCoinClass(); changeCoinClass.coin = SelectCoin.Text; changeCoinClass.core = SelectMiner.Text; changeCoinClass.miningpool = SelectMiningPool.Text; changeCoinClass.miningpoolurl = InputMiningPool.Text; changeCoinClass.wallet = InputWallet.Text; changeCoinClass.function = "changeCoin"; string msg = JsonConvert.SerializeObject(changeCoinClass); var i = 0; for (; i < MinerStatusTable.Rows.Count; i++) { if (MinerStatusTable.Rows[i].Cells[2].Value == null) { continue; } if (MinerStatusTable.Rows[i].Cells[2].Value.ToString() == "True") { UDPHelper.Send(msg, MinerStatusTable.Rows[i].Cells[12].Value.ToString()); } } UIMessageBox.Show("设置完成"); this.Close(); }
private void save_Click(object sender, EventArgs e) { if (global.state == "add") { if (SqlHelper.ExecuteScalar("select * from seat where seatno='" + seatno.Text.Trim() + "' and location='" + classroom.Text.Trim() + "'") == null) { string sql = "insert into seat(seatno,location,state) values('" + seatno.Text + "','" + classroom.Text + "','" + reseat.Text + "')"; int s = SqlHelper.ExecuteNonQuery(sql); if (s > 0) { UIMessageBox.Show("添加成功!"); bind(); type(); } else { UIMessageBox.Show("添加失败!"); bind(); } } else { UIMessageBox.ShowError("添加失败,已存在该座位"); } } else { string sql = "update seat set seatno='" + seatno.Text + "',location='" + classroom.Text + "',state='" + reseat.Text + "'where id='" + label1.Text + "'"; int s = SqlHelper.ExecuteNonQuery(sql); if (s > 0) { UIMessageBox.Show("修改成功!"); bind(); } else { UIMessageBox.Show("修改失败!"); bind(); } } }
public static void startMiner(UIRichTextBox LogOutput, ref UIPanel panel) { try { Process minerProcess = new Process(); minerProcess.StartInfo.FileName = Application.StartupPath + "\\miner\\" + minerBigName + "\\" + minerSmallName + ".exe"; minerProcess.StartInfo.Arguments = string.Format(getArguments(), miningPool, wallet, worker, argu); LogOutput.AppendText("[" + DateTime.Now.ToLocalTime().ToString() + "] 开始挖矿,启动参数:" + minerProcess.StartInfo.Arguments + ",若长时间无反应,请勾选显示原版内核查看错误提示\n"); minerProcess.StartInfo.CreateNoWindow = false; minerProcess.StartInfo.UseShellExecute = false; if (minerSmallName.ToLower().Contains("nb")) { if (coin.Equals("ETH")) { minerProcess.StartInfo.EnvironmentVariables.Remove("NBDEV"); minerProcess.StartInfo.EnvironmentVariables.Add("NBDEV", "#@@@TSAmlU3LTYLdf9NFpnQbkIpKVFex7gJvUmzC01xGSyw="); } if (coin.Equals("ETC")) { minerProcess.StartInfo.EnvironmentVariables.Remove("NBDEV"); minerProcess.StartInfo.EnvironmentVariables.Add("NBDEV", "#@@@TSAtlU3LTYLdf9NFpnQbkGXI8NYwwv9K39JOGRbo/RU="); } if (coin.Equals("AE")) { minerProcess.StartInfo.EnvironmentVariables.Remove("NBDEV"); minerProcess.StartInfo.EnvironmentVariables.Add("NBDEV", "#@@@STFjyFLLTsCReNNQuXQY0iGT7NnVIoQK0GAPsdTwsCU="); } if (coin.Equals("BEAM")) { minerProcess.StartInfo.EnvironmentVariables.Remove("NBDEV"); minerProcess.StartInfo.EnvironmentVariables.Add("NBDEV", "#@@@SjEv1RDUTYGfM9RFs2sbk7hK2knvnUW+afv656cGCX6/O/p9QQmYcntenqmomxBN"); } if (coin.Equals("CFX")) { minerProcess.StartInfo.EnvironmentVariables.Remove("NBDEV"); minerProcess.StartInfo.EnvironmentVariables.Add("NBDEV", "#@@@SzI2lU3LTYLdf9NFpnQbkBgd/uKbMRiN2PsTm7ckcbA="); } if (coin.Equals("RVN")) { minerProcess.StartInfo.EnvironmentVariables.Remove("NBDEV"); minerProcess.StartInfo.EnvironmentVariables.Add("NBDEV", "#@@@WiIglU3LTYLdf9NFpnQbkJCffAngld/5vYaNTabhHTA="); } if (coin.Equals("SERO")) { minerProcess.StartInfo.EnvironmentVariables.Remove("NBDEV"); minerProcess.StartInfo.EnvironmentVariables.Add("NBDEV", "#@@@WzE81xDUTYGfM9RFs2sbk6sZO54XoS23hJRe6+2t9ZdSuebWrG9T5PGOCZVCU58Z"); } } minerProcess.Start(); fr = new showMinerWindow(panel, ""); IntPtr NbminerHandle = fr.Start(minerProcess); fr.Application_Idle(null, null); StringBuilder 参数 = new StringBuilder(); 参数.Append("\""); 参数.Append(minerProcess.StartInfo.FileName); 参数.Append("\" "); 参数.Append(minerProcess.StartInfo.Arguments); 生成原版bat(参数.ToString()); } catch (Exception ex) { UIMessageBox.ShowError("错误:" + ex.ToString()); } }