Пример #1
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
            FmRoomManage roomManage = new FmRoomManage();

            roomManage.Show();
        }
Пример #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                ROOM rm = db.ROOMs.Where(d => d.ROOMID == room.ROOMID).FirstOrDefault();
                rm.ROOMNAME  = tbRoomName.Text;
                rm.BEDNUMBER = int.Parse(tbBed.Text);
                rm.BEDEMPTY  = int.Parse(tbBedEmpty.Text);
                if (cbbGender.SelectedItem.ToString().Equals("Nam"))
                {
                    rm.FORGENDER = 1;
                }
                else
                {
                    rm.FORGENDER = 2;
                }
                HOMEFLEET hf = (HOMEFLEET)cbbHF.SelectedItem;
                rm.HOMEFLEET = hf.HFID;
                rm.INCLUDED  = tbIncluded.Text;

                db.Entry(rm).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();

                MessageBox.Show("Chỉnh sửa thông tin phòng thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
                FmRoomManage roomManage = new FmRoomManage();
                roomManage.Show();
            }
            catch (Exception ex)
            {
                lbInformation.Text = ex.Message;
            }
        }