private void button2_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Trim() == "")
            {
                MessageBox.Show("请填写用户名!");
                return;
            }
            if (textBox2.Text.Trim() == "")
            {
                MessageBox.Show("请输入密码!");
                return;
            }
            if (textBox2.Text.Trim() != textBox3.Text.Trim())
            {
                MessageBox.Show("两次输入的密码不一致,请重新输入!");
                return;
            }

            String user_id, user_password, user_name, tel; int permissions;

            user_id       = textBox1.Text;
            user_password = textBox2.Text;
            permissions   = int.Parse(textBox4.Text);
            user_name     = textBox5.Text;
            tel           = textBox6.Text;
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.insert_user1(user_id, user_password, user_name, tel);
            chloe_obj.insert_user2(user_id, permissions);
        }
Ejemplo n.º 2
0
        //查询语句

        /*
         * public DataTable SelectYardid()
         * {
         *  Start ioj = new Start();
         *  String iu = Start.CUser;
         *  SqlConnection conn = new SqlConnection(@"Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");
         *  conn.Open();
         *  string sql = "select yARDID from Booking where book_personid='" + iu + "'";
         *  SqlCommand cmd = new SqlCommand(sql, conn);
         *  SqlDataAdapter sda = new SqlDataAdapter(cmd);
         *  DataTable dt = new DataTable();
         *  sda.Fill(dt);
         *  conn.Close();
         *  cmd.Dispose();
         *  return dt;
         *
         * }
         */


        private void Test_QX_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“场馆预约系统DataSet17.Booking”中。您可以根据需要移动或删除它。
            this.bookingTableAdapter.Fill(this.场馆预约系统DataSet17.Booking);

            //comboBox1.DataSource = SelectYardid();//绑定数据
            //comboBox1.DisplayMember = "yARDID";

            Start          ll        = new Start();
            String         LL        = Start.CUser;
            List <Booking> user_list = new List <Booking>();

            listView1.Items.Clear();
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            user_list = chloe_obj.person_search(LL);
            for (int i = 0; i < user_list.Count; i++)
            {
                ListViewItem user_item = new ListViewItem((i + 1).ToString(), i + 1);
                //user_item.SubItems.Add(user_list[i].UserName.ToString());
                user_item.SubItems.Add(user_list[i].Book_personid.ToString());
                user_item.SubItems.Add(user_list[i].Book_person.ToString());
                user_item.SubItems.Add(user_list[i].yARDID.ToString());
                user_item.SubItems.Add(user_list[i].OpenTime.ToString());
                user_item.SubItems.Add(user_list[i].CloseTime.ToString());
                user_item.SubItems.Add(user_list[i].BookDate.ToString());
                user_item.SubItems.Add(user_list[i].REALDate.ToString());
                user_item.SubItems.Add(user_list[i].Tel.ToString());
                user_item.SubItems.Add(user_list[i].BookCondition.ToString());
                listView1.Items.Add(user_item);
            }
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.del_suggest_all();
            FK_jianyi_Load(null, null);
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            //对于正常支付的用户,关闭信息窗后在PAY表增添对应信息
            //调用Booking中的数据
            //删除对应Booking表的数据
            YH_JS  mmp = new YH_JS();
            String iDDc;

            iDDc = YH_JS.CHANGDI;
            chloe_control_all chloe_usebook = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");
            Booking           usebooking    = new Booking();

            usebooking = chloe_usebook.See_BOOK_CD(iDDc);
            String   pay_id, pay_name, yard_id, begin_time, over_time, book_time, real_time, pay_money;
            DateTime pay_time;

            pay_id     = usebooking.Book_personid;
            pay_name   = usebooking.Book_person;
            yard_id    = usebooking.yARDID;
            begin_time = usebooking.OpenTime;
            over_time  = usebooking.CloseTime;
            book_time  = usebooking.BookDate.ToString();
            real_time  = usebooking.REALDate.ToLongDateString();
            pay_money  = YH_JS.MMMM;
            pay_time   = DateTime.Now;
            chloe_control_all chloe_obj_noproblem = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj_noproblem.UserPay(pay_id, pay_name, yard_id, begin_time, over_time, book_time, real_time, pay_money, pay_time);
            MessageBox.Show("已收到您的支付费用,欢迎再次预约!");
            Booking           del       = new Booking();
            chloe_control_all chloe_del = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_del.shoudaoqian(iDDc);
        }
        private void button3_Click(object sender, EventArgs e)
        {
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.del_hmd_all();
            GLY_heimingdan_Load(null, null);
        }
Ejemplo n.º 6
0
        private void button3_Click(object sender, EventArgs e)
        {
            //预订场地(insert Booking表)
            String   Yardid, oPentime, CLosetime, personname, tell, BJ, Bookdate;
            DateTime rEaltime;

            //用户使用时,一定要全部都选好填好再点击预订。
            Yardid    = (comboBox1.SelectedValue).ToString();
            oPentime  = (comboBox2.SelectedItem).ToString();
            CLosetime = (comboBox3.SelectedItem).ToString();
            //判断预约时间的前后是否正确
            DateTime dt1 = Convert.ToDateTime(oPentime);
            DateTime dt2 = Convert.ToDateTime(CLosetime);

            if (DateTime.Compare(dt1, dt2) > 0)
            {
                MessageBox.Show("请选择正确的时间段");
            }
            if (DateTime.Compare(dt1, dt2) == 0)
            {
                MessageBox.Show("不能选相同的时间!请重新时间段");
            }
            if (textBox2.Text.Trim() == "" | textBox3.Text.Trim() == "" | Yardid.ToString() == "")
            {
                MessageBox.Show("请填写好您的信息!不能为空噢!");
            }
            else
            {
                personname = textBox2.Text;
                tell       = textBox3.Text;
                Bookdate   = dateTimePicker1.Value.ToString();
                rEaltime   = DateTime.Now;
                BJ         = "YES";
                DateTime dt3 = Convert.ToDateTime(Bookdate);
                if (DateTime.Compare(dt3, rEaltime) < 0)
                {
                    MessageBox.Show("不能选以前的日期噢!");
                }
                else
                {
                    int    check_message_result;
                    String cd, st, ot, DAY;
                    cd  = comboBox1.SelectedValue.ToString();
                    st  = comboBox2.SelectedItem.ToString();
                    ot  = comboBox3.SelectedItem.ToString();
                    DAY = dateTimePicker1.Value.ToString();
                    chloe_control_all chloe_obj_message = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");
                    check_message_result = chloe_obj_message.checkbookmessage(cd, st, ot, DAY);
                    if (check_message_result == 0) //找不到重复的,直接预约
                    {
                        chloe_control_all chloe_obj1 = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");
                        chloe_obj1.YH_BOOK_Yard(Yardid, oPentime, CLosetime, Bookdate, rEaltime, personname, tell, BJ);
                    }
                    else if (check_message_result == 1)
                    {
                        MessageBox.Show("该天该时间段该场地已被人预约,请选择其他时间段或选择其他场地或选择预约其他日期!");
                    }
                }
            }
        }
Ejemplo n.º 7
0
        private void button2_Click(object sender, EventArgs e)
        {
            //对于支付有问题的用户,关闭信息窗后在PAY表增添对应信息,paymoney为"NULL"
            YH_JS  nm = new YH_JS();
            String iddc;

            iddc = YH_JS.CHANGDI;
            chloe_control_all chloe_usebook = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");
            Booking           havewt        = new Booking();

            havewt = chloe_usebook.See_BOOK_CD(iddc);
            String   id_pay, name_pay, id_yard, time_begin, time_over, time_book, time_real, money_pay;
            DateTime time_pay;

            id_pay     = havewt.Book_personid.ToString();
            name_pay   = havewt.Book_person.ToString();
            id_yard    = havewt.yARDID.ToString();
            time_begin = havewt.OpenTime.ToString();
            time_over  = havewt.CloseTime.ToString();
            //预订时间 = Booking表中的BookDate
            time_book = havewt.BookDate.ToString();
            time_real = havewt.REALDate.ToLongDateString().ToString();
            money_pay = PAYMONEY.Trim().ToString();
            time_pay  = DateTime.Now;
            chloe_control_all chloe_obj_haveproblem = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj_haveproblem.UserPay(id_pay, name_pay, id_yard, time_begin, time_over, time_book, time_real, money_pay, time_pay);
            MessageBox.Show("请联系系统管理员,管理员电话:132XXXXXXXX");
        }
Ejemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            String pay_id;

            pay_id = comboBox1.SelectedValue.ToString();
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.del_pay(pay_id);
            GLY_check_PAY_Load(null, null);
        }
Ejemplo n.º 9
0
        private void button2_Click(object sender, EventArgs e)
        {
            String select_yh_name;

            select_yh_name = comboBox1.SelectedValue.ToString();
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.del_YH(select_yh_name);
            GLY_xiugai_Load(null, null);
        }
Ejemplo n.º 10
0
        private void button2_Click(object sender, EventArgs e)
        {
            String book;

            book = comboBox1.SelectedValue.ToString();
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.QUXIAO_YD(book);
            Test_QX_Load(null, null);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            String select_book_id;

            select_book_id = comboBox1.SelectedValue.ToString();
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.gly_del_booking(select_book_id);
            GLY_yiyuyue_Load(null, null);
        }
        private void button4_Click(object sender, EventArgs e)
        {
            String select_name3;

            select_name3 = comboBox9.SelectedValue.ToString();
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.del_ggl_note(select_name3);
            Note_qingli_Load(null, null);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (USERNAME.Text.Trim() == "" | PASSWORD.Text.Trim() == "")
            {
                MessageBox.Show("用户名跟密码不能为空");
                return;
            }
            else
            {
                if (USERNAME.Text.Trim() == "TEST" && PASSWORD.Text.Trim() == "123")
                {
                    ONLY_ADD_USER creat_user = new ONLY_ADD_USER();
                    this.Hide();
                    MessageBox.Show("请根据要求填写好注册信息!");
                    creat_user.ShowDialog();
                    return;
                }
                else
                {
                    int login_result;
                    chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");
                    login_result = chloe_obj.login_check(USERNAME.Text, PASSWORD.Text);

                    if (login_result == 0)
                    {
                        MessageBox.Show("登录失败!  1.该用户不存在!2.您填写的用户名或密码有误!请重新输入!");
                        return;
                    }
                    if (login_result == 3)
                    {
                        MessageBox.Show("禁止使用本系统!请在解禁后登录!");
                        return;
                    }
                    if (login_result == 1)
                    {
                        GLY gly = new GLY();
                        this.Hide();
                        CUser = USERNAME.Text.ToString().Trim();
                        MessageBox.Show("欢迎管理员");
                        gly.ShowDialog();
                        return;
                    }
                    else if (login_result == 2)
                    {
                        YH yh = new YH();
                        this.Hide();
                        CUser = USERNAME.Text.ToString().Trim();
                        MessageBox.Show("欢迎使用广东理工学院场馆预约系统!");
                        MessageBox.Show("请遵守以下准则:1.强烈建议您预约场地时请先看通知,了解场地情况后再作预约!2.如果您临时有事未能按预约时间到达场地,请您及时取消预约!如果您未取消预约,且未到达场地的,将视作违约。3.一周内违约次数累积3次,将被拉入黑名单,禁止预约时间为一周。");
                        yh.ShowDialog();
                        return;
                    }
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            String hmd_id, hmd_name;

            hmd_id   = comboBox1.SelectedValue.ToString();
            hmd_name = comboBox2.SelectedValue.ToString();
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.inser_hmd(hmd_id, hmd_name);
            GLY_heimingdan_Load(null, null);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            String   neirong;
            DateTime writetime;

            neirong   = textBox1.Text;
            writetime = DateTime.Now;
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.inser_suggest(neirong, writetime);
            MessageBox.Show("感谢您的宝贵建议!");
        }
        private void YH_KanYongHu_Load(object sender, EventArgs e)
        {
            Start             SS        = new Start();
            String            oo        = Start.CUser;
            Login             user_info = new Login();
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            user_info      = chloe_obj.See_myself(oo);
            user_id.Text   = user_info.UserName;
            user_name.Text = user_info.RealName;
            user_tel.Text  = user_info.Tel;
        }
Ejemplo n.º 17
0
        private void button1_Click(object sender, EventArgs e)
        {
            String   noteid, title, information;
            DateTime notetime;

            noteid      = textBox1.Text;
            title       = textBox2.Text;
            information = textBox3.Text;
            notetime    = DateTime.Now;
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.inser_ggcontent(int.Parse(noteid), title, information, notetime);
        }
Ejemplo n.º 18
0
        private void button3_Click(object sender, EventArgs e)
        {
            //退出页面时,修改对应用户在User_BJ表中的BreakBJ和Award值(修改为"NO")
            Start             RR        = new Start();
            String            EE        = Start.CUser;
            User_BJ           bj        = new User_BJ();
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.XG_BJ(EE);
            this.Hide();
            YH yh2 = new YH();

            yh2.Show();
        }
        private void button3_Click(object sender, EventArgs e)
        {
            int Find_result;
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            Find_result = chloe_obj.user_find(textBox1.Text);
            if (Find_result == 0)
            {
                MessageBox.Show("该用户名可以使用!");
            }
            else if (Find_result == 1)
            {
                MessageBox.Show("该用户名已被注册,请重新输入");
            }
        }
Ejemplo n.º 20
0
        private void 已预约ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int bookcheck_result;
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            bookcheck_result = chloe_obj.gly_book_find();
            if (bookcheck_result == 0)
            {
                MessageBox.Show("暂无用户预约场地,请过几分钟再来!");
            }
            else
            {
                GLY_yiyuyue YYY = new GLY_yiyuyue();
                this.Hide();
                YYY.Show();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (textbox5.Text == "")
            {
                MessageBox.Show("请正确输入信息");
                return;
            }
            String id, name, address, time; int price;

            id      = textbox1.Text;
            name    = textbox2.Text;
            address = textbox3.Text;
            time    = textbox4.Text;
            price   = int.Parse(textbox5.Text);
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.Yard_XG(id, name, address, time, price);
        }
 private void button1_Click(object sender, EventArgs e)
 {
     if (YARDID.Text == "" && YARDADDRESSID.Text == "" && YARDNAMEID.Text == "" && OPENTIME.Text == "" && PRICE.Text == "" && BOOKCONDITION.Text == "")
     {
         MessageBox.Show("请将信息填写完整!");
     }
     else
     {
         String yardid, yardnameid, yardaddressid, opentime, price, bookcondition;
         yardid        = YARDID.Text;
         yardnameid    = YARDNAMEID.Text;
         yardaddressid = YARDADDRESSID.Text;
         opentime      = OPENTIME.Text;
         price         = PRICE.Text;
         bookcondition = BOOKCONDITION.Text;
         chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");
         chloe_obj.insert_yard(yardid, yardnameid, yardaddressid, opentime, int.Parse(price));
     }
 }
        private void test取消ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Start             vv = new Start();
            String            VV = Start.CUser;
            int               bookcheck_result;
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            bookcheck_result = chloe_obj.book_find(VV);
            if (bookcheck_result == 0)
            {
                MessageBox.Show("您还没有预约任意场地");
            }
            else
            {
                YH_quxiao qx = new YH_quxiao();
                this.Hide();
                qx.Show();
            }
        }
        private void test结算ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Start             xb = new Start();
            String            MM = Start.CUser;
            int               jsuser_find;
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            jsuser_find = chloe_obj.book_find(MM);
            if (jsuser_find == 0)
            {
                MessageBox.Show("您还没有预约任意场地,暂时没有结算信息!");
            }
            else
            {
                YH_JS cm = new YH_JS();
                this.Hide();
                cm.Show();
            }
        }
Ejemplo n.º 25
0
        private void button1_Click(object sender, EventArgs e)
        {
            int    YH_quanxian, YH_breaktime;
            String YH_id, YH_forbid, YH_award, YH_breakbj;

            if (textBox3.Text == "" | textBox6.Text == "")
            {
                MessageBox.Show("请正确输入信息!");
                return;
            }
            YH_quanxian  = int.Parse(textBox3.Text);
            YH_breaktime = int.Parse(textBox6.Text);
            YH_id        = textBox1.Text;
            YH_forbid    = textBox7.Text;
            YH_award     = textBox8.Text;
            YH_breakbj   = textBox2.Text;
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.XG_YH(YH_id, YH_quanxian, YH_breaktime, YH_forbid, YH_award, YH_breakbj);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Trim() == "")
            {
                MessageBox.Show("请输入密码!");
                return;
            }
            if (textBox1.Text.Trim() != textBox2.Text.Trim())
            {
                MessageBox.Show("两次输入的密码不一致,请重新输入!");
                return;
            }
            String yh_password, yh_name, yh_tel;

            yh_password = textBox1.Text;
            yh_name     = textBox3.Text;
            yh_tel      = textBox4.Text;
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            chloe_obj.xiugai_yh(yh_password, yh_name, yh_tel);
        }
        private void button7_Click(object sender, EventArgs e)
        {
            List <User_BJ> user_list = new List <User_BJ>();
            String         Search1   = "";

            Search1 = (String)UserIDDD.SelectedItem;
            user_info_display.Items.Clear();
            chloe_control_all chloe_obj = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            user_list = chloe_obj.User_Search(Search1);
            for (int i = 0; i < user_list.Count; i++)
            {
                ListViewItem user_item = new ListViewItem((i + 1).ToString(), i + 1);
                //user_item.SubItems.Add(user_list[i].UserName.ToString());
                user_item.SubItems.Add(user_list[i].UserName.ToString());
                user_item.SubItems.Add(user_list[i].Permissions.ToString());
                user_item.SubItems.Add(user_list[i].BreakTime.ToString());
                user_item.SubItems.Add(user_list[i].Forbid.ToString());
                user_item.SubItems.Add(user_list[i].Award.ToString());
                user_item.SubItems.Add(user_list[i].BreakBJ.ToString());
                user_info_display.Items.Add(user_item);
            }
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            //选择好场地id和日期后,点击支付按钮,先判断其有无奖励或者违规标记,有奖励,弹窗提示免单,然后将该条数据保存在PAY表,然后删除该条数据
            //将用户的免单标记值修改为NO
            //有违规,弹窗显示其为存在违规,需加收违约金,然后弹窗显示支付金额,进入扫码支付界面进行支付,正常付钱,将数据写进PAY表,删除Booking表中该条数据
            //支付不正常,将数据写进PAY表,Booking表对应数据不删除
            //返回时,还原其标记值
            //为普通用户,弹窗显示支付金额,进入扫码支付界面进行支付,后面如上。

            //判断用户
            Start             NE21       = new Start();
            String            NE22       = Start.CUser;
            chloe_control_all chloe_obj1 = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");
            Booking           BigBang    = new Booking();

            BigBang = chloe_obj1.See_BOOK_CD(comboBox1.SelectedValue.ToString());
            int BJ_check_result;

            BJ_check_result = chloe_obj1.User_checkkkkk(NE22);
            if (BJ_check_result == 3)   //该值为3时是奖励用户
            {
                MessageBox.Show("您为奖励用户,已为您本次消费免单!");
                String   pay_id, pay_name, yard_id, begin_time, over_time, book_time, real_time, pay_money;
                DateTime pay_time;
                pay_id     = BigBang.Book_personid.ToString();
                pay_name   = BigBang.Book_person.ToString();
                yard_id    = comboBox1.SelectedValue.ToString();
                begin_time = BigBang.OpenTime.ToString();
                over_time  = BigBang.CloseTime.ToString();
                book_time  = BigBang.BookDate.ToString();
                real_time  = BigBang.REALDate.ToLongDateString().ToString();
                pay_money  = (Paymoney).Trim().ToString();
                pay_time   = DateTime.Now;
                chloe_control_all chloe_obj2 = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");
                chloe_obj2.UserPay(pay_id, pay_name, yard_id, begin_time, over_time, book_time, real_time, pay_money, pay_time);
                Booking           del       = new Booking();
                User_BJ           bj        = new User_BJ();
                chloe_control_all chloe_del = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");
                chloe_obj2.QUXIAO_YD(comboBox1.SelectedValue.ToString());
                chloe_del.XG_BJ(NE22);
            }
            else
            {
                //违规用户
                int bj_result;
                bj_result = chloe_obj1.USER_CHECK(NE22);
                if (bj_result == 0)
                {
                    countmoney();
                    MessageBox.Show("系统检测到您为违约用户,需在本次消费中收取违约金");
                    MessageBox.Show("您需要支付:" + MMMM.ToString() + "元");
                    Count_pay2 br = new Count_pay2();
                    CHANGDI = comboBox1.SelectedValue.ToString();
                    this.Hide();
                    br.Show();
                }
                //正常用户
                countmoney();
                MessageBox.Show("您需要支付:" + MMMM.ToString() + "元");
                Count_pay2 nor = new Count_pay2();
                CHANGDI = comboBox1.SelectedValue.ToString();
                this.Hide();
                nor.Show();
            }
        }
        public void countmoney()
        {
            //此方法用于计算用户租赁场地的花销
            //获取listview中的开始时间和结束时间,计算时间差。
            //用户花的钱 = 时间差*对应场地单价+(违约金)
            //违约金 = (时间差*对应场地单价)*0.3
            //是否需要缴纳违约金看用户的BreakBJ标记是否为YES 为YES,加收,不为YES,不收

            //先根据选取的场地id获取对应的场地价格
            Yard jiage = new Yard();
            chloe_control_all chloe_price = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            jiage = chloe_price.catchprice(comboBox1.SelectedValue.ToString()); // ()调用的是控件comboBox的值,即场地id
            double cdprice;

            cdprice = jiage.Price;
            //再根据场地id获取对应列的开始时间和结束时间
            Start             waailu     = new Start();
            String            chalang    = Start.CUser;
            Booking           leihou     = new Booking();
            chloe_control_all chloe_time = new chloe_control_all("Data Source=DESKTOP-O4C25KM;Initial Catalog=场馆预约系统;Integrated Security=True");

            leihou = chloe_time.See_BOOK_CD(comboBox1.SelectedValue.ToString());
            //开始时间、结束时间、中午、下午(用于计算和转换)
            String START, EXIT, MID, AFT;

            START = leihou.OpenTime.ToString();
            EXIT  = leihou.CloseTime.ToString();
            MID   = mid;
            AFT   = aft;
            DateTime dt1 = Convert.ToDateTime(START);
            DateTime dt2 = Convert.ToDateTime(EXIT);
            DateTime dt3 = Convert.ToDateTime(MID);
            DateTime dt4 = Convert.ToDateTime(AFT);
            TimeSpan ts1 = new TimeSpan(dt1.Ticks);
            TimeSpan ts2 = new TimeSpan(dt2.Ticks);
            TimeSpan ts3 = new TimeSpan(dt3.Ticks);
            TimeSpan ts4 = new TimeSpan(dt4.Ticks);
            //计算时间差(然后计算两个TimeSpan的差)
            //时间计算还得区分中午12:00-下午14:00这两个小时的休息时间
            //如果选择的开始时间小于等于12:00以及结束的时间大于等于14:00,实际的消费时间为(12:00-开始时间)+ (结束时间-14:00)
            String ALLtime; //计算出来的时间差

            if (DateTime.Compare(dt1, dt3) <= 0 && DateTime.Compare(dt2, dt4) >= 0)
            {
                TimeSpan ts5 = ts1.Subtract(ts3).Duration();         //(12:00-开始时间)
                TimeSpan ts6 = ts2.Subtract(ts4).Duration();         //(结束时间-14:00)
                TimeSpan ts7 = ts5.Add(ts6).Duration();              //实际的消费时间
                double   t   = ts7.TotalHours / Convert.ToDouble(1); //将TimeSpan转换类型,便于后期计算费用,精确至小数点后两位
                double   t1  = Convert.ToDouble(t);
                ALLtime = t1.ToString();
            }
            else
            {
                TimeSpan ts = ts1.Subtract(ts2).Duration();
                double   m  = ts.TotalHours / Convert.ToDouble(1);
                double   m1 = Convert.ToDouble(m);
                ALLtime = m1.ToString();
            }
            //判断用户标记,计算不同的钱
            //Visa代表违约用户的总金额 VISA代表正常用户的总金额
            //MMMM代表总金额
            double Visa, VISA;
            int    BJ_check_result;

            BJ_check_result = chloe_time.USER_CHECK(chalang);
            if (BJ_check_result == 0) //用户违约用户,需收取违约金
            {
                Visa = double.Parse(ALLtime) * cdprice * 1.3;
                MMMM = Visa.ToString();
            }
            else
            {
                VISA = double.Parse(ALLtime) * cdprice;
                MMMM = VISA.ToString();
            }
        }