Beispiel #1
0
 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;
     }
 }
Beispiel #2
0
        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;
                    }
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// 确认操作的设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_ok_Click(object sender, EventArgs e)
        {
            if (textBox_business.Text.Equals("") && (textBox_people.Text.Equals("") || textBox_customer.Text.Equals("")))
            {
                MessageBox.Show("提示:会议室的安排的信息不能为空,请输入正确的信息!", "Tips");
                return;
            }
            Room_Info r = new Room_Info(textBox_name.Text, textBox_people.Text, textBox_customer.Text, textBox_business.Text, dateTimePicker_time.Value.ToString(), dateTimePicker1.Value.ToString(), richTextBox_tips.Text, false);

            if (Scheduled)//预约确认
            {
                string[] roomInfo = new string[8];
                roomInfo[0] = roomIndex + "_" + textBox_name.Text;
                roomInfo[1] = textBox_name.Text;
                roomInfo[2] = textBox_people.Text;
                roomInfo[3] = textBox_customer.Text;
                roomInfo[4] = textBox_business.Text;
                roomInfo[5] = dateTimePicker_time.Value.ToString("yyyy-MM-dd HH:mm:00");
                roomInfo[6] = dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:00");
                roomInfo[7] = richTextBox_tips.Text;
                if (ModifyFlag)//预约信息修改确认操作
                {
                    AccessFunction.DeleteClientProtocol(roomIndex + "_" + textBox_name.Text);
                    ModifyFlag = false;
                }
                AccessFunction.InsertClientProtocol(roomInfo);
                f.OtherSend(string.Format("reservate,{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}", selfUserNember, peerUserIPEndPoint, roomIndex, textBox_name.Text, textBox_people.Text, textBox_customer.Text, textBox_business.Text, dateTimePicker_time.Value.ToString("yyyy-MM-dd HH:mm:00"), dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:00"), richTextBox_tips.Text));
            }
            else
            {
                if (!DeleteFlag)      //预约信息删除确认操作
                {
                    r.Setstate(true); //设置需要使用状态
                    f.SetRoom(textBox_name.Text, r);

                    f.OtherSend(string.Format("addin,{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}", selfUserNember, peerUserIPEndPoint, roomIndex, textBox_name.Text, textBox_people.Text, textBox_customer.Text, textBox_business.Text, dateTimePicker_time.Value.ToString("yyyy-MM-dd HH:mm:00"), dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:00"), richTextBox_tips.Text));
                }
            }
            this.Close();
        }