private void btnPageDown_Click(object sender, EventArgs e) { listView1.Items.Clear(); if (currentpage < totalpage) { currentpage++; } if (currentpage == totalpage) { currentpage = totalpage; } textBoxNow.Text = currentpage.ToString(); if (expertflag == 0) { DataTable dt = pageshow.ListviewShow("select * from Placement_Data order by Class_week", currentpage, pagesize, "Placement_Data"); UIShow show = new UIShow(); show.placement_listview_write(dt, listView1, currentpage, pagesize); } else { DataTable dt = pageshow.ListviewShow("select * from CheckPlacement_Data order by Class_week", currentpage, pagesize, "CheckPlacement_Data"); UIShow show = new UIShow(); show.placement_listview_write(dt, listView1, currentpage, pagesize); } }
private void buttonX2_Click(object sender, EventArgs e) { if (listView1.CheckedItems.Count != 0) { SqlHelper help = new SqlHelper(); string condition = " where " + "Teacher='" + listView1.CheckedItems[0].SubItems[1].Text + "'"; if (help.delete("Teachers_Data", condition) > 0) { MessageBox.Show("删除成功"); } else { MessageBox.Show("删除失败"); } listView1.Items.Clear(); setTbEnable(); clear_listview(); totalpage = pageshow.totalpage("select * from Teachers_Data", pagesize, "Teachers_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow("select * from Teachers_Data", currentpage, pagesize, "Teachers_Data"); UIShow show = new UIShow(); show.teachers_listview_write(dt, listView1); groupBox1.SendToBack(); } }
public static void CaculateQuerySpan(WillCaculatefn fn, UIShow uishow, ContentControl ctl, ProgressRing progress) { #region string tmp = ""; progress.IsActive = true; DateTime starttime = DateTime.Now; fn.BeginInvoke(new AsyncCallback((IAsyncResult) => { DateTime endtime = DateTime.Now; if (MainWindow.IsConnectingDB) { tmp = string.Format("上次查询时长:{0}ms", (endtime - starttime).TotalMilliseconds); } else { tmp = "上次查询时长:超时!"; } ctl.Dispatcher.BeginInvoke(new UIShow(() => { ctl.Content = tmp; progress.IsActive = false; uishow.Invoke(); })); }), fn); #endregion }
public void GengXin_OK() { UIShow ushow = new UIShow(); for (int i = 1; i <= 8 && i < listView1.Items.Count; i++) { ushow.Led_XianShiGngXin(i, listView1); Thread.Sleep(1000); } }
public void frmLog_Load_1(object sender, EventArgs e) { listView1.Items.Clear(); CheckForIllegalCrossThreadCalls = false; totalpage = help.totalpage("select * from Logs_Data", pagesize, "Logs_Data"); labPageAll.Text = totalpage.ToString(); DataTable dt = help.ListviewShow("select * from Logs_Data", currentpage, pagesize, "Logs_Data"); UIShow show = new UIShow(); show.logs_listview_write(dt, listView1, currentpage, pagesize); }
//外部调用,暂时不明作用 public void NewMethod() { clear_listview(); DataTable dt = pageshow.ListviewShow("select * from Classes_Data", currentpage, pagesize, "Classes_Data"); UIShow show = new UIShow(); show.listview_write_classes_data(dt, listView1); pageshow = new SqlHelper(); totalpage = pageshow.totalpage("select * from Classes_Data", pagesize, "Classes_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); }
public void flashListview_check() { //--------------------------------------------- listView1.Items.Clear(); pageshow = new SqlHelper(); totalpage = pageshow.totalpage("select * from CheckPlacement_Data", pagesize, "CheckPlacement_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow("select * from CheckPlacement_Data order by Class_week", currentpage, pagesize, "CheckPlacement_Data"); UIShow show = new UIShow(); show.placement_listview_write(dt, listView1, currentpage, pagesize); }
public virtual bool GetItem() { FX.EffectPlay(FX.SYSTEMS.SYSTEM_GETITEMS); if (ThisType == TYPE.PASSIVE) { UIShow UI = Instantiate(SHOW_UI, transform.position, Quaternion.identity).GetComponent <UIShow>(); UI.ShopImage = ShopImage; _Name.text = Name; Info.text = Short_Info; UI.Name = _Name; UI.Info = Info; } return(true); }
private void buttonX4_Click(object sender, EventArgs e) { clear_listview(); if (currentpage < totalpage) { currentpage++; } if (currentpage == totalpage) { currentpage = totalpage; } textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow("select * from Classes_Data", currentpage, pagesize, "Classes_Data"); UIShow show = new UIShow(); show.listview_write_classes_data(dt, listView1); }
private void buttonX5_Click(object sender, EventArgs e) { listView1.Items.Clear(); if (currentpage < totalpage) { currentpage++; } if (currentpage == totalpage) { currentpage = totalpage; } textBoxNow.Text = currentpage.ToString(); DataTable dt = help.ListviewShow("select * from Logs_Data", currentpage, pagesize, "Logs_Data"); UIShow show = new UIShow(); show.logs_listview_write(dt, listView1, currentpage, pagesize); }
private void frmPlan_Load(object sender, EventArgs e) { try { listView1.Items.Clear(); pageshow = new SqlHelper(); totalpage = pageshow.totalpage("select * from Classes_Data", pagesize, "Classes_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow("select * from Classes_Data", currentpage, pagesize, "Classes_Data"); UIShow show = new UIShow(); show.listview_write_classes_data(dt, listView1); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void buttonX5_Click(object sender, EventArgs e) { clear_listview(); if (currentpage > 1) { currentpage--; //numTurnPage -= 17; } if (currentpage == 1) { currentpage = 1; //numTurnPage = 0; } textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow("select * from Teachers_Data", currentpage, pagesize, "Teachers_Data"); UIShow show = new UIShow(); show.teachers_listview_write(dt, listView1); }
private void buttonX3_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtSearch.Text)) { frmTeacher_Load(sender, e); } else { listView1.Items.Clear(); string fe = "Teacher like '%" + txtSearch.Text.Trim() + "%'"; string cmdText = "SELECT * FROM Teachers_Data WHERE " + fe; pageshow = new SqlHelper(); totalpage = pageshow.totalpage(cmdText, pagesize, "Teachers_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow(cmdText, currentpage, pagesize, "Teachers_Data"); UIShow show = new UIShow(); show.teachers_listview_write(dt, listView1); } }
private void buttonX6_Click(object sender, EventArgs e) { clear_listview(); if (currentpage < totalpage) { currentpage++; //numTurnPage += 17; } if (currentpage == totalpage) { currentpage = totalpage; //numTurnPage = (totalpage - 1) * 17; } textBoxNow.Text = currentpage.ToString(); // cListview pageshow = new cListview(); DataTable dt = pageshow.ListviewShow("select * from Teachers_Data", currentpage, pagesize, "Teachers_Data"); UIShow show = new UIShow(); show.teachers_listview_write(dt, listView1); }
private void btnSearch_Click(object sender, EventArgs e) { if (expertflag == 0) { if (string.IsNullOrWhiteSpace(txtSearch.Text)) { }// flashListview(); else { listView1.Items.Clear(); string fe = "Teacher like '%" + txtSearch.Text.Trim() + "%' or Supervisor_Name like '%" + txtSearch.Text.Trim() + "%'"; string cmdText = "SELECT * FROM Placement_Data WHERE " + fe; pageshow = new SqlHelper(); totalpage = pageshow.totalpage(cmdText, pagesize, "Placement_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow(cmdText, currentpage, pagesize, "Placement_Data"); UIShow show = new UIShow(); show.placement_listview_write(dt, listView1, currentpage, pagesize); } } else { if (string.IsNullOrWhiteSpace(txtSearch.Text)) { }// flashListview(); else { listView1.Items.Clear(); string fe = "Teacher like '%" + txtSearch.Text.Trim() + "%' or Supervisor_Name like '%" + txtSearch.Text.Trim() + "%'"; string cmdText = "SELECT * FROM CheckPlacement_Data WHERE " + fe; pageshow = new SqlHelper(); totalpage = pageshow.totalpage(cmdText, pagesize, "CheckPlacement_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow(cmdText, currentpage, pagesize, "CheckPlacement_Data"); UIShow show = new UIShow(); show.placement_listview_write(dt, listView1, currentpage, pagesize); } } }
private void frmTeacher_Load(object sender, EventArgs e) { listView1.Items.Clear(); setTbEnable(); NoIdTeacher();//添加对应的教师 pageshow = new SqlHelper(); totalpage = pageshow.totalpage("select * from Teachers_Data", pagesize, "Teachers_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow("select * from Teachers_Data", currentpage, pagesize, "Teachers_Data"); UIShow show = new UIShow(); show.teachers_listview_write(dt, listView1); groupBox1.SendToBack(); }
private void buttonX4_Click(object sender, EventArgs e) { //if ( tBName.Text != "" && tBMail.Text != "" && tBTel.Text != "" && tbTitle.Text != "" && tbBelongs.Text != "") //{ string EmailPattern = @"^([A-Za-z0-9]{1}[A-Za-z0-9_]*)@([A-Za-z0-9_]+)[.]([A-Za-z0-9_]*)$";//E-Mail地址格式的正则表达式 if (tBMail.Text == "" || Regex.IsMatch(tBMail.Text.Trim(), EmailPattern)) { if (status == 1) { TeacherInfo teacher = new TeacherInfo(); teacher.TeacherId = tBID.Text; teacher.TeacherName = tBName.Text; teacher.Email = tBMail.Text; teacher.Phone = tBTel.Text; teacher.Title = tbTitle.Text; teacher.IsSupervisor = cbIsDUDao.Checked; teacher.TeachingSection = tbBelongs.Text; SqlHelper help = new SqlHelper(); if (help.update("Teachers_Data", teacher) > 0) { MessageBox.Show("修改成功"); listView1.Items.Clear(); DataTable dt = pageshow.ListviewShow("select * from Teachers_Data", currentpage, pagesize, "Teachers_Data"); UIShow show = new UIShow(); show.teachers_listview_write(dt, listView1); } } if (status == 0) { TeacherInfo teacher = new TeacherInfo(); teacher.TeacherId = tBID.Text; teacher.TeacherName = tBName.Text; teacher.Email = tBMail.Text; teacher.Phone = tBTel.Text; teacher.Title = tbTitle.Text; teacher.IsSupervisor = cbIsDUDao.Checked; teacher.TeachingSection = tbBelongs.Text; SqlHelper help = new SqlHelper(); if (help.Insert(teacher, "Teachers_Data") > 0) { MessageBox.Show("添加成功"); } else { MessageBox.Show("操作失败"); } clear_listview(); totalpage = pageshow.totalpage("select * from Teachers_Data", pagesize, "Teachers_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow("select * from Teachers_Data", currentpage, pagesize, "Teachers_Data"); UIShow show = new UIShow(); show.teachers_listview_write(dt, listView1); } this.btnsave.Enabled = false; } else { MessageBox.Show("请输入正确的邮箱地址"); } // } //else //{ // MessageBox.Show("请确保数据完整"); //} }
private void buttonX2_Click(object sender, EventArgs e) { listView1.Items.Clear(); if (currentpage < totalpage) { currentpage++; } if (currentpage == totalpage) { currentpage = totalpage; } textBoxNow.Text = currentpage.ToString(); if (expertflag == 0) { DataTable dt = pageshow.ListviewShow("select * from Placement_Data order by Class_week", currentpage, pagesize, "Placement_Data"); UIShow show = new UIShow(); show.placement_listview_write(dt, listView1, currentpage, pagesize); } else { DataTable dt = pageshow.ListviewShow("select * from CheckPlacement_Data order by Class_week", currentpage, pagesize, "CheckPlacement_Data"); UIShow show = new UIShow(); show.placement_listview_write(dt, listView1, currentpage, pagesize); } }
private void frmPlan_Load(object sender, EventArgs e) { try { listView1.Items.Clear(); pageshow = new SqlHelper(); totalpage = pageshow.totalpage("select * from Classes_Data", pagesize, "Classes_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow("select * from Classes_Data",currentpage,pagesize,"Classes_Data"); UIShow show = new UIShow(); show.listview_write_classes_data(dt,listView1); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
void Awake() { instance = this; isTopCam = true; }
private void Function(object sender, EventArgs e) { Control Cols = sender as Control; switch (Cols.Text) { case "系统控制": tabControl1.SelectedIndex = 0; if (tabControl1.TabPages[0].Controls.Count == 0) { if (_tmepUI) { _UIShow = new UIShow(); _UIShow._SetModBus = new Action <string>(SetModBus); _UIShow._SetObjModBus = new Action <object>(SendFuntion); _UIShow.Dock = DockStyle.Fill; tabControl1.TabPages[0].Controls.Add(_UIShow); } else { //_UIShowImg = new UIShowImg(); //_UIShowImg._SetModBus = new Action<string>(SetModBus); //_UIShowImg._SetObjModBus = new Action<object>(SendFuntion); //_UIShowImg.Dock = DockStyle.Fill; //tabControl1.TabPages[0].Controls.Add(_UIShowImg); _UCKGS = new UCKGS(); _UCKGS.Dock = DockStyle.Fill; _UCKGS._SetModBus = new Action <string>(SetModBus); _UCKGS._SetObjModBus = new Action <object>(SendFuntion); tabControl1.TabPages[0].Controls.Add(_UCKGS); } //现场 } break; case "手动控制": tabControl1.SelectedIndex = 1; if (tabControl1.TabPages[1].Controls.Count == 0) { _UIControl = new UIControl(); _UIControl._SetCMD = new Action <string>(SetUpathPoint); _UIControl.Dock = DockStyle.Fill; tabControl1.TabPages[1].Controls.Add(_UIControl); } break; case "日志查询": // tabControl1.SelectedIndex = 2; _UCanPanl = new UCanPanl(); _UCanPanl._UTask = new Action <string>(SetPLCTask); if (tabControl1.TabPages[2].Controls.Count == 0) { _UCanPanl.Dock = DockStyle.Fill; tabControl1.TabPages[2].Controls.Add(_UCanPanl); } break; case "系统设置": tabControl1.SelectedIndex = 3; if (tabControl1.TabPages[3].Controls.Count == 0) { tabControl1.TabPages[3].Controls.Add(new USetPLC()); } break; case "Cnf5": tabControl1.SelectedIndex = 4; if (tabControl1.TabPages[4].Controls.Count == 0) { //tabControl1.TabPages[4].Controls.Add(new UMeus()); } break; case "Cnf6": tabControl1.SelectedIndex = 5; break; case "关机退出": DialogResult result = MessageBox.Show("您确认要退出系统吗?", "深圳慧尔普温馨提示!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk); if (result == DialogResult.OK) { //执行OK的代码 this.Close(); } else { //执行Cancel的代码 } break; } }
private void btnSearch_Click(object sender, EventArgs e) { if (expertflag==0) { if (string.IsNullOrWhiteSpace(txtSearch.Text)) { }// flashListview(); else { listView1.Items.Clear(); string fe = "Teacher like '%" + txtSearch.Text.Trim() + "%' or Supervisor_Name like '%" + txtSearch.Text.Trim() + "%'"; string cmdText = "SELECT * FROM Placement_Data WHERE " + fe; pageshow = new SqlHelper(); totalpage = pageshow.totalpage(cmdText, pagesize, "Placement_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow(cmdText, currentpage, pagesize, "Placement_Data"); UIShow show = new UIShow(); show.placement_listview_write(dt, listView1, currentpage, pagesize); } } else { if (string.IsNullOrWhiteSpace(txtSearch.Text)) { }// flashListview(); else { listView1.Items.Clear(); string fe = "Teacher like '%" + txtSearch.Text.Trim() + "%' or Supervisor_Name like '%" + txtSearch.Text.Trim() + "%'"; string cmdText = "SELECT * FROM CheckPlacement_Data WHERE " + fe; pageshow = new SqlHelper(); totalpage = pageshow.totalpage(cmdText, pagesize, "CheckPlacement_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow(cmdText, currentpage, pagesize, "CheckPlacement_Data"); UIShow show = new UIShow(); show.placement_listview_write(dt, listView1, currentpage, pagesize); } } }
private void buttonX4_Click(object sender, EventArgs e) { //if ( tBName.Text != "" && tBMail.Text != "" && tBTel.Text != "" && tbTitle.Text != "" && tbBelongs.Text != "") //{ string EmailPattern = @"^([A-Za-z0-9]{1}[A-Za-z0-9_]*)@([A-Za-z0-9_]+)[.]([A-Za-z0-9_]*)$"; //E-Mail地址格式的正则表达式 if (tBMail.Text == "" || Regex.IsMatch(tBMail.Text.Trim(), EmailPattern)) { if (status == 1) { TeacherInfo teacher = new TeacherInfo(); teacher.TeacherId = tBID.Text; teacher.TeacherName = tBName.Text; teacher.Email = tBMail.Text; teacher.Phone = tBTel.Text; teacher.Title = tbTitle.Text; teacher.IsSupervisor = cbIsDUDao.Checked; teacher.TeachingSection = tbBelongs.Text; SqlHelper help = new SqlHelper(); if (help.update("Teachers_Data", teacher) > 0) { MessageBox.Show("修改成功"); listView1.Items.Clear(); DataTable dt = pageshow.ListviewShow("select * from Teachers_Data", currentpage, pagesize, "Teachers_Data"); UIShow show = new UIShow(); show.teachers_listview_write(dt, listView1); } } if (status == 0) { TeacherInfo teacher = new TeacherInfo(); teacher.TeacherId = tBID.Text; teacher.TeacherName = tBName.Text; teacher.Email = tBMail.Text; teacher.Phone = tBTel.Text; teacher.Title = tbTitle.Text; teacher.IsSupervisor = cbIsDUDao.Checked; teacher.TeachingSection = tbBelongs.Text; SqlHelper help = new SqlHelper(); if (help.Insert(teacher, "Teachers_Data") > 0) { MessageBox.Show("添加成功"); } else { MessageBox.Show("操作失败"); } clear_listview(); totalpage = pageshow.totalpage("select * from Teachers_Data", pagesize, "Teachers_Data"); labPageAll.Text = totalpage + ""; textBoxNow.Text = currentpage.ToString(); DataTable dt = pageshow.ListviewShow("select * from Teachers_Data", currentpage, pagesize, "Teachers_Data"); UIShow show = new UIShow(); show.teachers_listview_write(dt, listView1); } this.btnsave.Enabled = false; } else { MessageBox.Show("请输入正确的邮箱地址"); } // } //else //{ // MessageBox.Show("请确保数据完整"); //} }