示例#1
0
        private void TuiChu()
        {
            //退出程序
            DialogResult aa = MessageBox.Show("您真的要离开我吗?", "提示", MessageBoxButtons.OKCancel);

            if (aa == DialogResult.OK)
            {
                Win32.AnimateWindow(this.Handle, 300, Win32.AW_HIDE | Win32.AW_VER_POSITIVE | Win32.AW_SLIDE);
                Application.Exit();
            }
        }
示例#2
0
 private void MainInterface_Load(object sender, EventArgs e)
 {
     //淡出特效隐藏
     if (Win32.AnimateWindow(this.Handle, 300, Win32.AW_BLEND | Win32.AW_HIDE))
     {
         //淡入特效显示
         Win32.AnimateWindow(this.Handle, 300, Win32.AW_BLEND | Win32.AW_ACTIVATE);
     }
     //Win32.AnimateWindow(this.Handle, 300, Win32.AW_ACTIVATE | Win32.AW_VER_POSITIVE | Win32.AW_SLIDE);
     ZaiRu();
     lbYongHu.Text = string.Format("{0}({1})", QuanXuang, CaoZuoYuan);
     timer2.Start();
     btXiaoXi.BackgroundImage = imageList1.Images[0];
 }
示例#3
0
 private void BusinessInquiries_Load(object sender, EventArgs e)
 {
     Win32.AnimateWindow(this.Handle, 300, Win32.AW_CENTER | Win32.AW_ACTIVATE | Win32.AW_SLIDE);
     //    tpKaiShi.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
     //    //tpJieShu.Value = DateTime.Now.Date.AddMonths(1).AddDays(-DateTime.Now.Day);
     ZaiRu();
     //计算房间营收
     if (dgvFangJian.Rows.Count > 0)
     {
         double aa = 0;
         double bb = 0;
         for (int i = 0; i < dgvFangJian.Rows.Count; i++)
         {
             aa += Convert.ToDouble(dgvFangJian.Rows[i].Cells[1].Value.ToString());
             bb += Convert.ToDouble(dgvFangJian.Rows[i].Cells[2].Value.ToString());
         }
         textXingJin.Text = aa.ToString();
         textYuE.Text     = bb.ToString();
     }
     //计算商品营收
     if (dgvShangPing.Rows.Count > 0)
     {
         double aa = 0;
         for (int i = 0; i < dgvShangPing.Rows.Count; i++)
         {
             aa += Convert.ToDouble(dgvShangPing.Rows[i].Cells[1].Value.ToString());
         }
         textShangPing.Text = aa.ToString();
     }
     //计算充值营收
     if (dgvChongZhi.Rows.Count > 0)
     {
         double aa = 0;
         for (int i = 0; i < dgvChongZhi.Rows.Count; i++)
         {
             aa += Convert.ToDouble(dgvChongZhi.Rows[i].Cells[1].Value.ToString());
         }
         textChongZhi.Text = aa.ToString();
     }
     if (dgvZhiChu.Rows.Count > 0)
     {
         double aa = 0;
         for (int i = 0; i < dgvZhiChu.Rows.Count; i++)
         {
             aa += Convert.ToDouble(dgvZhiChu.Rows[i].Cells[1].Value.ToString());
         }
         txtZhiChu.Text = aa.ToString();
     }
 }
示例#4
0
        //安全登录按钮
        private void BtDengLu_Click(object sender, EventArgs e)
        {
            //用户名和密码不能为空
            if (tbZhangHao.Text.Equals("") || tbMiMa.Text.Equals(""))
            {
                MessageBox.Show("用户名或密码不能为空!", "提示");
                return;
            }
            if (!TianXieQuanXian())
            {
                MessageBox.Show("用户名或密码错误!", "提示");
                return;
            }
            //打开主界面
            MainInterface MI = new MainInterface();

            MI.CaoZuoYuan = tbZhangHao.Text;
            MI.QuanXuang  = cbQuanXuan.Text;
            try
            {
                //获取酒店名称
                string        sql = string.Format(@"select *
                                        from [dbo].[HotelName]");
                SqlDataReader dr  = db.SelectDataReader(sql);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        MI.Text = dr[0].ToString() + "酒店管理系统 V2021";
                    }
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
            finally
            {
                db.CloseConnection();
            }
            Win32.AnimateWindow(this.Handle, 300, Win32.AW_HIDE | Win32.AW_VER_POSITIVE | Win32.AW_SLIDE);
            this.Hide();
            MI.Show();
        }
示例#5
0
 private void BulkGuestOpening_Load(object sender, EventArgs e)
 {
     ZaiRuKongJinFang();
     ZaiRuFangJianLeiXing();
     ShengChengID();
     cbFuKuangFangShi.SelectedIndex = 0;
     Win32.AnimateWindow(this.Handle, 300, Win32.AW_HOR_POSITIVE | Win32.AW_ACTIVATE | Win32.AW_SLIDE);
     //当预定单不为空的时候执行
     if (YuDingDan != null)
     {
         try
         {
             string        sql = string.Format(@"select *
                                         from [dbo].[PredeterminedTable]
                                         where reservationNumber = '{0}'", YuDingDan);
             SqlDataReader dr  = db.SelectDataReader(sql);
             if (dr.HasRows)
             {
                 while (dr.Read())
                 {
                     tbXingMing.Text = dr["Name"].ToString();
                     tbDianHua.Text  = dr["Phone"].ToString();
                     ListViewItem items = new ListViewItem(dr["RoomID"].ToString());
                     items.SubItems.Add(dr["RoomType"].ToString());
                     items.SubItems.Add(dr["Price"].ToString());
                     lvYiXuang.Items.Add(items);
                     tpRuZhu.Text = dr["PreconditioningTime"].ToString();
                     tpYuLi.Text  = dr["PreDepartureTime"].ToString();
                 }
                 JiSuanJiaGe();
             }
         }
         catch (Exception ee)
         {
             MessageBox.Show(ee.Message);
         }
         finally
         {
             db.CloseConnection();
         }
     }
 }
示例#6
0
        private void skinButton1_Click(object sender, EventArgs e)
        {
            if (tbXingMing.Text.Equals("") || tbNianLing.Text.Equals("") || tbShengFenngZheng.Text.Equals(""))
            {
                MessageBox.Show("抱歉!请认真填写所有信息!");
                return;
            }
            if (Convert.ToDouble(tbZhaoLing.Text) < 0)
            {
                MessageBox.Show("抱歉!实付金额不足!");
                return;
            }
            if (lvYiXuang.Items.Count == 0)
            {
                MessageBox.Show("抱歉!请选择入住房间!");
                return;
            }
            string sex = "男";

            if (rbNv.Checked)
            {
                sex = "女";
            }
            //将新顾客信息新增到顾客表
            if (tbGuKe.Text.Equals("是"))
            {
                try
                {
                    //新顾客余额为0
                    string yuE = "0";
                    //将顾客信息新增顾客表
                    string sql = string.Format(@"insert into CustomerTable(Name, CarID, Phone, Balance, Type, Sex, Age)
                                values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", tbXingMing.Text, tbShengFenngZheng.Text, tbDianHua.Text, yuE, "1", sex, tbNianLing.Text);
                    if (db.ExecuteSQLCommand(sql) > 0)
                    {
                        //新增成功
                    }
                    else
                    {
                        MessageBox.Show("顾客信息填入顾客表失败");
                    }
                }
                catch (Exception ee)
                {
                    MessageBox.Show(ee.Message);
                }
                finally
                {
                    db.CloseConnection();
                }
            }
            try
            {
                //获取已选房间数
                int a       = lvYiXuang.Items.Count;
                int fangShu = 0;
                //循环输入已选房间
                for (int i = 0; i < a; i++)
                {
                    string FangJianHao = lvYiXuang.Items[i].Text.ToString();
                    try
                    {
                        string sql    = "";
                        double zheKou = 1;
                        if (tbZhiKou.Text != "不打折")
                        {
                            zheKou = Convert.ToDouble(tbZhiKou.Text.Substring(0, 1)) / 10;
                        }
                        double FangJias = Convert.ToDouble(lvYiXuang.Items[i].SubItems[2].Text);

                        //在订单表中插入相应数据
                        if (cbFuKuangFangShi.Text == "现金支付")
                        {
                            sql = string.Format(@"insert into [dbo].[OrderTable](OrderID, RoomID, UName, Age, Deposit, CheckInTime, PreDepartureTime, Phone, CustomerType, CompanyName, Remarks, State, Address, Discounts, AmountReceived, PaymentMethod, Operator, Price)
                                        values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}')"
                                                , tbDingDanHao.Text, FangJianHao, tbXingMing.Text, tbNianLing.Text, "0", tpRuZhu.Text, tpYuLi.Text, tbDianHua.Text, tbLeiXing.Text, FangJias * zheKou, tbBeiZhu.Text, "新开单", tbDiZhi.Text, tbZhiKou.Text, FangJias * zheKou, cbFuKuangFangShi.Text, CaoZuoYuan, FangJias);
                        }
                        else if (cbFuKuangFangShi.Text == "账户余额")
                        {
                            sql = string.Format(@"insert into [dbo].[OrderTable](OrderID, RoomID, UName, Age, Deposit, CheckInTime, PreDepartureTime, Phone, CustomerType, CompanyName, Remarks, State, Address, Discounts, AmountReceived, PaymentMethod, Operator, Price)
                                        values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}')"
                                                , tbDingDanHao.Text, FangJianHao, tbXingMing.Text, tbNianLing.Text, FangJias * zheKou, tpRuZhu.Text, tpYuLi.Text, tbDianHua.Text, tbLeiXing.Text, "0", tbBeiZhu.Text, "新开单", tbDiZhi.Text, tbZhiKou.Text, FangJias * zheKou, cbFuKuangFangShi.Text, CaoZuoYuan, FangJias);
                        }
                        else if (cbFuKuangFangShi.Text == "现金+余额")
                        {
                            double xianJins = Convert.ToDouble(tbXiangJin.Text) / lvYiXuang.Items.Count;
                            double yuEss    = Convert.ToDouble(tbYuEFuKuan.Text) / lvYiXuang.Items.Count;
                            sql = string.Format(@"insert into [dbo].[OrderTable](OrderID, RoomID, UName, Age, Deposit, CheckInTime, PreDepartureTime, Phone, CustomerType, CompanyName, Remarks, State, Address, Discounts, AmountReceived, PaymentMethod, Operator, Price)
                                        values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}')"
                                                , tbDingDanHao.Text, FangJianHao, tbXingMing.Text, tbNianLing.Text, yuEss, tpRuZhu.Text, tpYuLi.Text, tbDianHua.Text, tbLeiXing.Text, xianJins, tbBeiZhu.Text, "新开单", tbDiZhi.Text, tbZhiKou.Text, xianJins + yuEss, cbFuKuangFangShi.Text, CaoZuoYuan, FangJias);
                        }


                        if (db.ExecuteSQLCommand(sql) > 0)
                        {
                            fangShu++;
                            //修改房间状态
                            sql = string.Format(@"update RoomTable set StateID = 2
                                                where RoomID ='{0}'", FangJianHao);
                            if (db.ExecuteSQLCommand(sql) == 0)
                            {
                                MessageBox.Show("修改房间状态失败,请手动修改!");
                            }
                        }
                        else
                        {
                            MessageBox.Show("入住失败!");
                        }
                    }
                    catch (Exception ee)
                    {
                        MessageBox.Show(ee.Message);
                    }
                    finally
                    {
                        db.CloseConnection();
                    }
                }
                if (fangShu == a)
                {
                    MessageBox.Show("入住成功!");
                    Activation at = new Activation();
                    at.FangHao = lvYiXuang.Items[0].Text.ToString();
                    at.ShowDialog();
                    //语音提示
                    string            YuYinTiShi = string.Format("找零{0}元", tbZhaoLing.Text);
                    SpeechSynthesizer synth      = new SpeechSynthesizer();
                    synth.Speak(YuYinTiShi);
                    if (YuDingDan != null)
                    {
                        this.DialogResult = DialogResult.OK;
                    }
                    Win32.AnimateWindow(this.Handle, 300, Win32.AW_HOR_POSITIVE | Win32.AW_HIDE | Win32.AW_SLIDE);
                    this.Close();
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
            finally
            {
                db.CloseConnection();
            }
        }
示例#7
0
 private void Lonin_Load(object sender, EventArgs e)
 {
     Win32.AnimateWindow(this.Handle, 300, Win32.AW_ACTIVATE | Win32.AW_VER_POSITIVE | Win32.AW_SLIDE);
 }
示例#8
0
 private void BusinessInquiries_FormClosing(object sender, FormClosingEventArgs e)
 {
     Win32.AnimateWindow(this.Handle, 300, Win32.AW_CENTER | Win32.AW_HIDE | Win32.AW_SLIDE);
 }
示例#9
0
 private void MainInterface_FormClosing(object sender, FormClosingEventArgs e)
 {
     Win32.AnimateWindow(this.Handle, 300, Win32.AW_HIDE | Win32.AW_VER_POSITIVE | Win32.AW_SLIDE);
     Application.Exit();
 }