Пример #1
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            //打开顾客散客开单
            BulkGuestOpening bg = new BulkGuestOpening();

            bg.CaoZuoYuan = CaoZuoYuan;
            //入住成功后刷新房间信息
            bg.ShowDialog();
            ZaiRu();
        }
Пример #2
0
 private void 入住ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (dgvDingDan.SelectedRows.Count > 0)
     {
         DateTime dt1 = Convert.ToDateTime(dgvDingDan.SelectedRows[0].Cells[5].Value.ToString());
         DateTime dt2 = DateTime.Now;
         TimeSpan ts  = dt1 - dt2;
         if (ts.Hours >= 12 || ts.Days > 0)
         {
             MessageBox.Show("提早的太久了!", "提示");
             return;
         }
         if ((dgvDingDan.SelectedRows[0].Cells[9].Value.ToString() != ("预定中")))
         {
             MessageBox.Show("抱歉!不是预定中状态不能入住!", "提示");
             return;
         }
         BulkGuestOpening bk = new BulkGuestOpening();
         bk.YuDingDan = dgvDingDan.SelectedRows[0].Cells[0].Value.ToString();
         if (bk.ShowDialog() == DialogResult.OK)
         {
             try
             {
                 string sql = string.Format(@"update PredeterminedTable set Type ='已入住'
                                             where reservationNumber = '{0}'", dgvDingDan.SelectedRows[0].Cells[0].Value.ToString());
                 db.ExecuteSQLCommand(sql);
             }
             catch (Exception ee)
             {
                 MessageBox.Show(ee.Message);
             }
             finally
             {
                 db.CloseConnection();
             }
             ChaXun();
         }
     }
 }