private void SaveButton_Click(object sender, EventArgs e)
        {
            LazyWorker <Employee> .Update(FilledDataToEmployee());

            LoadAllEmployees();
            MessageBox.Show("Dữ liệu đã được cập nhật thành công!");
        }
 private void SaveButton_Click(object sender, EventArgs e)
 {
     if (LazyWorker <Customer> .Update(FilledDataToCustomer()))
     {
         LoadAllCustomer();
         FormUtilities.NotifySuccess();
     }
 }
 private void SaveRoomButton_Click(object sender, EventArgs e)
 {
     if (LazyWorker <Room> .Update(FilledDataToRoom()))
     {
         FormUtilities.NotifySuccess();
         LoadAllRooms(RoomComboBox.SelectedIndex);
     }
 }
        private void SaveServiceButton_Click(object sender, EventArgs e)
        {
            if (LazyWorker <ServiceModel> .Update(FilledDataToService()))
            {
                int index = ServiceGridView.SelectedRows[0].Index;
                LoadAllServices();
                FormUtilities.SetRowIndex(ServiceGridView, index);

                FormUtilities.NotifySuccess();
            }
        }
Example #5
0
 private void SaveServiceButton_Click(object sender, EventArgs e)
 {
     if (currentBill.Id == 0 || ServiceComboBox.SelectedIndex == 0)
     {
         FormUtilities.NotifyFailure();
         return;
     }
     if (LazyWorker <BillDetail> .Update(FilledDataToBillDetail()))
     {
         LoadBillsServices();
         FormUtilities.NotifySuccess();
     }
     else
     {
         FormUtilities.NotifyFailure();
     }
 }
 private void SaveBillButton_Click(object sender, EventArgs e)
 {
     if (LazyWorker <BillModel> .Update
         (
             new BillModel()
     {
         Id = currentBill.Id,
         CustomerId = (CustomerComboBox.SelectedIndex == 0 ? null : (int?)CustomerComboBox.SelectedIndex),
         EmployeeId = (EmployeeComboBox.SelectedIndex == 0 ? null : (int?)EmployeeComboBox.SelectedIndex),
         CreatingDay = currentBill.CreatingDay
     }
         ))
     {
         FormUtilities.NotifySuccess();
     }
     else
     {
         FormUtilities.NotifyFailure();
     }
 }
        private void AcceptButton_Click(object sender, EventArgs e)
        {
            if (StringUtilities.MD5Hash(OldPasswordTextbox.Text) == emp.Password)
            {
                if (NewPasswordTextbox.Text == RepeatNewPasswordTextbox.Text)
                {
                    emp.Password = StringUtilities.MD5Hash(NewPasswordTextbox.Text);
                    LazyWorker <Employee> .Update(emp);

                    MessageBox.Show("Đổi mật khẩu thành công!");
                }
                else
                {
                    MessageBox.Show("Mật khẩu mới không trùng lặp!");
                }
            }
            else
            {
                MessageBox.Show("Mật khẩu cũ không đúng!");
            }
        }