Ejemplo n.º 1
0
 private void SaveRoomButton_Click(object sender, EventArgs e)
 {
     if (LazyWorker <Room> .Update(FilledDataToRoom()))
     {
         FormUtilities.NotifySuccess();
         LoadAllRooms(RoomComboBox.SelectedIndex);
     }
 }
Ejemplo n.º 2
0
 private void SaveButton_Click(object sender, EventArgs e)
 {
     if (LazyWorker <Customer> .Update(FilledDataToCustomer()))
     {
         LoadAllCustomer();
         FormUtilities.NotifySuccess();
     }
 }
Ejemplo n.º 3
0
        private void NewRoomButton_Click(object sender, EventArgs e)
        {
            RoomIdNumericUpDown.Value
                = LazyWorker <Room> .Insert(FilledDataToRoom());

            LoadAllRooms(Int32.MaxValue);
            FormUtilities.NotifySuccess();
        }
Ejemplo n.º 4
0
        private void DeleteRoomButton_Click(object sender, EventArgs e)
        {
            if (FormUtilities.ConfirmDeletion())
            {
                LazyWorker <Room> .Delete(FilledDataToRoom());

                LoadAllRooms();
            }
        }
Ejemplo n.º 5
0
 private void RoomNameTextbox_Validating(object sender, CancelEventArgs e)
 {
     FormUtilities.CharacterLengthValidating
     (
         ValidatingErrorProvider,
         RoomNameTextbox,
         "Tên phòng", 1, 30
     );
 }
Ejemplo n.º 6
0
 private void ServiceNameTextbox_Validating(object sender, CancelEventArgs e)
 {
     FormUtilities.CharacterLengthValidating
     (
         ValidatingErrorProvider,
         RoomNameTextbox,
         "Tên dịch vụ", 1, 50
     );
 }
Ejemplo n.º 7
0
 private void PhonenumberTextbox_Validating(object sender, CancelEventArgs e)
 {
     FormUtilities.NumericCharactersValidating
     (
         ValidatingErrorProvider,
         RealLifeIdNumberTextbox,
         "Số điện thoại", 8
     );
 }
Ejemplo n.º 8
0
 private void RealLifeIdNumberTextbox_Validating(object sender, CancelEventArgs e)
 {
     FormUtilities.NumericCharactersValidating
     (
         ValidatingErrorProvider,
         RealLifeIdNumberTextbox,
         "Số CMND (hoặc CCCD)", 9
     );
 }
Ejemplo n.º 9
0
 private void FullNameTextbox_Validating(object sender, CancelEventArgs e)
 {
     FormUtilities.CharacterLengthValidating
     (
         ValidatingErrorProvider,
         FullNameTextbox,
         "Họ tên",
         1, 50
     );
 }
Ejemplo n.º 10
0
 private void PasswordTextbox_Validating(object sender, CancelEventArgs e)
 {
     FormUtilities.CharacterLengthValidating
     (
         ValidatingErrorProvider,
         PasswordTextbox,
         "Mật khẩu",
         6, 31
     );
 }
Ejemplo n.º 11
0
 private void UsernameTextbox_Validating(object sender, CancelEventArgs e)
 {
     FormUtilities.CharacterLengthValidating
     (
         ValidatingErrorProvider,
         UsernameTextbox,
         "Tên đăng nhập",
         5, 20
     );
 }
Ejemplo n.º 12
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            if (FormUtilities.ConfirmDeletion())
            {
                LazyWorker <Customer> .Delete(FilledDataToCustomer());

                LoadAllCustomer();
                ResetButton_Click(sender, e);
            }
        }
Ejemplo n.º 13
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            if (FormUtilities.ConfirmDeletion())
            {
                LazyWorker <Employee> .Delete(FilledDataToEmployee());

                LoadAllEmployees();
                LoadOneEmployee(new Employee());
            }
        }
Ejemplo n.º 14
0
 private void DeleteServiceButton_Click(object sender, EventArgs e)
 {
     if (FormUtilities.ConfirmDeletion() &&
         LazyWorker <ServiceModel> .Delete(FilledDataToService()))
     {
         LoadAllRooms();
         ResetServiceButton_Click(sender, e);
         FormUtilities.NotifySuccess();
     }
 }
Ejemplo n.º 15
0
        private void NewServiceButton_Click(object sender, EventArgs e)
        {
            ServiceIdNumericUpDown.Value = LazyWorker <ServiceModel> .Insert(FilledDataToService());

            LoadAllServices();
            FormUtilities.SetRowIndex(ServiceGridView);
            SaveServiceButton.Enabled   = true;
            DeleteServiceButton.Enabled = true;
            FormUtilities.NotifySuccess();
        }
Ejemplo n.º 16
0
        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();
            }
        }
Ejemplo n.º 17
0
 private void NewButton_Click(object sender, EventArgs e)
 {
     if
     (
         (IdNumericUpdown.Value
              = LazyWorker <Customer> .Insert(FilledDataToCustomer())) > 0
     )
     {
         LoadAllCustomer();
         FormUtilities.NotifySuccess();
     }
 }
Ejemplo n.º 18
0
 private void AddServiceButton_Click(object sender, EventArgs e)
 {
     if (currentBill.Id == 0 || ServiceComboBox.SelectedIndex == 0)
     {
         FormUtilities.NotifyFailure();
         return;
     }
     if (LazyWorker <BillDetail> .Insert(FilledDataToBillDetail()) > 0)
     {
         LoadBillsServices();
         FormUtilities.NotifySuccess();
     }
     else
     {
         FormUtilities.NotifyFailure();
     }
 }
Ejemplo n.º 19
0
 private void RemoveServiceButton_Click(object sender, EventArgs e)
 {
     if (currentBill.Id == 0)
     {
         FormUtilities.NotifyFailure();
         return;
     }
     if (LazyWorker <BillDetail> .Delete(FilledDataToBillDetail()))
     {
         LoadBillsServices();
         FormUtilities.NotifySuccess();
     }
     else
     {
         FormUtilities.NotifyFailure();
     }
 }
Ejemplo n.º 20
0
 private void DeleteBillButton_Click(object sender, EventArgs e)
 {
     if (LazyWorker <BillModel> .Delete
         (
             new BillModel()
     {
         Id = currentBill.Id
     }
         ))
     {
         SetCurrentBill(new BillDisplay());
         FormUtilities.NotifySuccess();
     }
     else
     {
         FormUtilities.NotifyFailure();
     }
 }
Ejemplo n.º 21
0
 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();
     }
 }
Ejemplo n.º 22
0
 private void ServiceFilterTextbox_TextChanged(object sender, EventArgs e)
 {
     FormUtilities.FilterDataGridView(ServiceGridView, ServiceFilterTextbox.Text);
 }
Ejemplo n.º 23
0
 private void FilterTextbox_TextChanged(object sender, EventArgs e)
 {
     FormUtilities.FilterDataGridView(EmployeeGridView, FilterTextbox.Text);
 }