Exemple #1
0
        public void saveDate()
        {
            CUSTOMER customer = new CUSTOMER()
            {
                ID = textIDCus.Text, CustomerName = textHoTen.Text, DateOfBirth = datePickerBirth.Value, Address = textAddress.Text, NumberPhone = textSDT.Text, Sexual = comBoxSexual.Text
            };

            data.CUSTOMERs.Add(customer);
            data.SaveChanges();
        }
Exemple #2
0
        public void saveDate()
        {
            ROOMRANK temp = new ROOMRANK()
            {
                RankName = textRankName.Text, Price = int.Parse(textPrice.Text), Deposits = int.Parse(textDeposit.Text), About = textAbout.Text
            };

            data.ROOMRANKs.Add(temp);
            data.SaveChanges();
        }
Exemple #3
0
        public void saveData()
        {
            ROOMRANGE temp = new ROOMRANGE()
            {
                RangeName = textRangeName.Text
            };

            data.ROOMRANGEs.Add(temp);
            data.SaveChanges();
        }
Exemple #4
0
        public void saveDate()
        {
            MOTELROOM room = new MOTELROOM()
            {
                RoomName = textRoomName.Text, StateRoom = false, IDRoomRank = int.Parse(comBoxIDRank.Text), IDRoomRange = int.Parse(comBoxIDRange.Text)
            };

            data.MOTELROOMs.Add(room);
            data.SaveChanges();
        }
Exemple #5
0
        public void saveData()
        {
            decimal a    = decimal.Parse(textPrice.Text);
            SERVICE temp = new SERVICE()
            {
                ServiceName = textServiceName.Text, Price = a
            };

            data.SERVICEs.Add(temp);
            data.SaveChanges();
        }
Exemple #6
0
        private void butComfirm_Click(object sender, EventArgs e)
        {
            if (listRoom.SelectedItems.Count > 0 && listGuest.SelectedItems.Count > 0)
            {
                DialogResult result = MessageBox.Show("Ban co chac khach co ID = " + listGuest.FocusedItem.Text + " tra phong khong? (tat ca cac du lieu lien quan deu se bi xoa!)", "WARNING", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                switch (result)
                {
                case DialogResult.Cancel: return;

                case DialogResult.Yes:
                {
                    REINTINFOR temp = data.REINTINFORs.Find(textIDGuest.Text, int.Parse(textIDRoom.Text));
                    temp.CheckOutDate = datePickerCheckOut.Value;
                    data.SaveChanges();
                    clearShow();
                    listGuest.Clear();
                    loadRoom();

                    break;
                }

                case DialogResult.No: return;

                default:
                    break;
                }
            }
            else
            {
                MessageBox.Show("hay chon phong va khach tu danh sach!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemple #7
0
        private void butXoa_Click(object sender, EventArgs e)
        {
            if (listRoom.SelectedItems.Count > 0)
            {
                using (MotelManagerEntities data = new MotelManagerEntities())
                {
                    DialogResult result = MessageBox.Show("Ban co chac xoa phong co ID = " + listRoom.FocusedItem.Text + " khong? (tat ca cac du lieu lien quan deu se bi xoa!)", "WARNING", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                    switch (result)
                    {
                    case DialogResult.Cancel: return;

                    case DialogResult.Yes:
                    {
                        MOTELROOM temp = data.MOTELROOMs.Find(int.Parse(listRoom.FocusedItem.Text));
                        data.MOTELROOMs.Remove(temp);
                        data.SaveChanges();
                        listRoom.Clear();
                        loadRoom(0, soLuong);
                        dem = 0;
                        break;
                    }

                    case DialogResult.No: return;

                    default:
                        break;
                    }
                }
            }
            else
            {
                MessageBox.Show("hay chon phong tu danh sach!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemple #8
0
        public void updateData()
        {
            USER temp = data.USERs.Find(textUserName.Text);

            temp.Password = textNewPass.Text;
            data.SaveChanges();
        }
Exemple #9
0
        private void butXoa_Click(object sender, EventArgs e)
        {
            if (listStaff.SelectedItems.Count > 0)
            {
                using (MotelManagerEntities data = new MotelManagerEntities())
                {
                    DialogResult result = MessageBox.Show("Ban co chac xoa quan ly co ID = " + listStaff.FocusedItem.Text + " khong? (tat ca cac du lieu lien quan deu se bi xoa!)", "WARNING", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                    switch (result)
                    {
                    case DialogResult.Cancel: return;

                    case DialogResult.Yes:
                    {
                        STAFF temp = data.STAFFs.Find(listStaff.FocusedItem.Text);
                        data.STAFFs.Remove(temp);
                        data.SaveChanges();
                        listStaff.Clear();
                        loadData();
                        break;
                    }

                    case DialogResult.No: return;

                    default:
                        break;
                    }
                }
            }
            else
            {
                MessageBox.Show("Hay chon quan ly can xoa tu danh sach!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemple #10
0
        public void saveDate()
        {
            STAFF staff = new STAFF()
            {
                ID = textIDStaff.Text, StaffName = textHoTen.Text, DateOfBirth = datePickerBirth.Value, Address = textAddress.Text, NumberPhone = textSDT.Text, UserName = textUserName.Text, Sexual = comBoxSexual.Text
            };

            data.STAFFs.Add(staff);
            data.SaveChanges();
            USER user = new USER()
            {
                UserName = textUserName.Text, Password = "", IDRole = 2
            };

            data.USERs.Add(user);
            data.SaveChanges();
        }