private bool SetFlag = true;//修改标记 /// <summary> /// 安排设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SetToolStripMenuItem_Click(object sender, EventArgs e) { try { string s = listView_Schedul.SelectedItems[0].SubItems[1].Text; DataTable tables = AccessFunction.SearchClientProtocol(roomIndex + "_" + textBox_name.Text, s); //int Rows = tables.Rows.Count; listView_Schedul.Items.Remove(listView_Schedul.SelectedItems[0]); if (tables != null && tables.Rows.Count > 0) { DeleteFlag = false; ModifyFlag = false; SetFlag = false; //textBox_name.Text = tables.Rows[r][3].ToString(); textBox_people.Text = tables.Rows[0][2].ToString(); textBox_customer.Text = tables.Rows[0][3].ToString(); textBox_business.Text = tables.Rows[0][4].ToString(); dateTimePicker_time.Value = DateTime.Parse(tables.Rows[0][5].ToString()); dateTimePicker1.Value = DateTime.Parse(tables.Rows[0][6].ToString()); richTextBox_tips.Text = tables.Rows[0][7].ToString(); checkBoxX1.Checked = false; } //AccessFunction.DeleteTerminalProtocol(roomIndex + "_" + textBox_name.Text, s); AccessFunction.DeleteClientProtocol(roomIndex + "_" + textBox_name.Text); } catch { return; } }
private bool DeleteFlag = false;//修改标记 /// <summary> /// 删除预约 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DeleteToolStripMenuItem_Click(object sender, EventArgs e) { DeleteFlag = true; string s = listView_Schedul.SelectedItems[0].SubItems[1].Text; DataTable tables = AccessFunction.SearchClientProtocol(roomIndex + "_" + textBox_name.Text, s); //int Rows = tables.Rows.Count; if (tables != null && tables.Rows.Count > 0) { string s1 = listView_Schedul.SelectedItems[0].SubItems[2].Text; string s2 = listView_Schedul.SelectedItems[0].SubItems[3].Text; //Console.WriteLine(s1); if (!s1.Equals("")) { try { f.OtherSend(string.Format("delete,{0},{1},{2},{3},{4},{5}", selfUserNember, peerUserIPEndPoint, roomIndex, textBox_name.Text, s1, s2)); listView_Schedul.Items.Remove(listView_Schedul.SelectedItems[0]); //AccessFunction.DeleteTerminalProtocol(roomIndex + "_" + textBox_name.Text, s); AccessFunction.DeleteClientProtocol(roomIndex + "_" + textBox_name.Text); //string message = roomIndex + "_" + textBox_name.Text + "," + s; //Thread DeleteThread = new Thread(DeleteInfoFromTable); //DeleteThread.Start(message); } catch { return; } } } }