private void FrmRoomManager_Load_1(object sender, EventArgs e)
 {
     CmpSetDgv();
     cboReserWay.SelectedIndex = 0;
     dgvBou.DataSource         = ReserService.SelectReserAll();
     Type.DataSource           = RoomTypeManager.SelectRoomTypesAll();
     Type.DisplayMember        = "RoomName"; //显示的列名
     Type.ValueMember          = "Roomtype"; //绑定的值
 }
        private void picDeleteReser_Click(object sender, EventArgs e)
        {
            string        sql = "delete from RESER where ReserId='" + txtReserNo.Text + "'";
            SqlConnection con = DBHelper.GetConnection();
            int           n   = DBHelper.ExecuteNonQuery(sql);

            MessageBox.Show("删除预约信息成功", "删除提示");
            txtReserNo.Text   = "";
            dgvBou.DataSource = ReserService.SelectReserAll();
        }
 private void picSearch_Click(object sender, EventArgs e)
 {
     if (txtCustoTel.Text == "")
     {
         MessageBox.Show("请输入预约电话!", "提示信息");
         txtCustoTel.Focus();
     }
     else
     {
         string tel = txtCustoTel.Text;
         dgvBou.DataSource = ReserService.SelectReserInfoByConn(tel);
     }
 }
 private void picUpdate_Click(object sender, EventArgs e)
 {
     if (txtReserNo.Text == "")
     {
         MessageBox.Show("还没选择预约客户信息,无法进行修改!");
     }
     else
     {
         int           n   = 0;
         string        sql = "update RESER set CustoName='" + txtCustoName.Text + "',CustoTel='" + txtCustoTel.Text + "',ReserWay='" + cboReserWay.Text + "',ReserRoom='" + Type.SelectedIndex + "',ReserCash='" + ReserCash.Text + "',ReserDate='" + dtpBouDate.Value.ToShortDateString() + "',ReserPerson='" + txtReserNum.Text + "',ReserRemark='" + txtMessage.Text + "' where ReserId='" + txtReserNo.Text + "'";
         SqlConnection con = DBHelper.GetConnection();
         n = DBHelper.ExecuteNonQuery(sql);
         MessageBox.Show("修改预约信息成功");
         dgvBou.DataSource = ReserService.SelectReserAll();
     }
 }
        private void btnReser_Click(object sender, EventArgs e)
        {
            Random random  = new Random();
            string reserid = "";

            reserid = new CounterHelper().GetNewId("ReserId");
            Reser reser = new Reser()
            {
                ReserId     = reserid,
                CustoName   = txtCustoName.Text.Trim(),
                CustoTel    = txtCustoTel.Text.Trim(),
                ReserWay    = cboReserWay.Text,
                ReserRoom   = cboReserRoomNo.Text,
                ReserDate   = dtpBouDate.Value,
                ReserEndDay = dtpEndDate.Value
            };
            Room room = new Room()
            {
                RoomNo      = cboReserRoomNo.Text,
                RoomStateId = 4
            };
            bool result1 = new ReserService().InserReserInfo(reser);
            bool result2 = new RoomService().UpdateRoomInfoWithReser(room);

            if (result1 == true && result2 == true)
            {
                MessageBox.Show("预约成功!请在指定时间内进行登记入住");
                #region 获取添加操作日志所需的信息
                OperationLog o = new OperationLog();
                o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                o.Operationlog     = LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName + "于" + DateTime.Now + "帮助" + txtCustoTel.Text + "进行了预订房间操作!";
                o.OperationAccount = LoginInfo.WorkerNo;
                o.datains_usr      = LoginInfo.WorkerNo;
                o.datains_date     = DateTime.Now;
                #endregion
                new OperationlogService().InsertOperationLog(o);
                this.Close();
            }
        }
 private void picAddReserInfo_Click(object sender, EventArgs e)
 {
     if (txtReserNo.Text == "")
     {
         MessageBox.Show("预约编号不能为空!", "TS提醒");
     }
     else
     {
         int           n   = 0;
         string        sql = "insert RESER values('" + txtReserNo.Text + "','" + txtCustoName.Text + "','" + txtCustoTel.Text + "','" + cboReserWay.Text + "','" + Type.SelectedIndex + "','" + ReserCash.Text + "','" + dtpBouDate.Value + "','" + txtReserNum.Text + "','" + txtMessage.Text + "')";
         SqlConnection con = DBHelper.GetConnection();
         n = DBHelper.ExecuteNonQuery(sql);
         MessageBox.Show("添加预约信息成功");
         dgvBou.DataSource = ReserService.SelectReserAll();
         txtCustoName.Text = "";
         txtCustoTel.Text  = "";
         cboReserWay.Text  = "";
         Type.Text         = "";
         ReserCash.Text    = "";
         dtpBouDate.Text   = "";
         txtReserNum.Text  = "";
         txtMessage.Text   = "";
     }
 }
Esempio n. 7
0
 public static int InserReserInfo(Reser r)
 {
     return(ReserService.InserReserInfo(r));
 }
Esempio n. 8
0
 public static List <Reser> SelectReserAll()
 {
     return(ReserService.SelectReserAll());
 }
Esempio n. 9
0
 public static int DeleteReserInfo(string rid)
 {
     return(ReserService.DeleteReserInfo(rid));
 }
Esempio n. 10
0
        public static Reser SelectReserInfoByRoomNo(string no)
        {
            Reser r = ReserService.SelectReserInfoByRoomNo(no);

            return(r);
        }
        public Reser SelectReserInfoByRoomNo([FromUri] string no)
        {
            Reser r = new ReserService().SelectReserInfoByRoomNo(no);

            return(r);
        }