Example #1
0
        private void loadcboStatus()
        {
            Models.RoomMod lcbostatus = new Models.RoomMod();
            DataTable      dt         = lcbostatus.loadStatus();

            cboStatus.DataSource    = dt;
            cboStatus.DisplayMember = "TenTrangThai";
            cboStatus.ValueMember   = "MaTrangThai";
        }
Example #2
0
        //trong sự kiện nút lưu
        private void btnSave_Click(object sender, EventArgs e)
        {
            Models.RoomMod edit = new Models.RoomMod();
            //tạo các biến để gán giá trị vào hàm update
            string name = txtRoomName.Text;
            string stt  = cboStatus.SelectedValue.ToString();//lưu trạng thái mới để cập nhật vào bản
            string dec  = txtDescription.Text;
            string area = txtAcreage.Text;
            string max  = txtCapacity.Text;

            if (edit.editRoom(idRoom, stt, name, dec, area, max) == true)// chạy hàm update
            {
                Close();
            }
            // load lại listview
        }
Example #3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     Models.RoomMod add = new Models.RoomMod();
     if (txtAcreage.Text == "")
     {
         txtAcreage.Text = "0";
     }
     if (txtCapacity.Text == "")
     {
         txtCapacity.Text = "0";
     }
     if (txtRoomName.Text == "")
     {
         txtRoomName.Text = "P.Mới";
     }
     if (add.addRoom(Value()) == true)
     {
         Close();
     }
 }