private void updateAllRegistrationDitchList()
        {
            CommClient.RegistrationDitch           registrationDitchClient = new CommClient.RegistrationDitch();
            List <CommContracts.RegistrationDitch> list = registrationDitchClient.GetAllRegistrationDitch();

            this.AllRegistrationDitchViewList.ItemsSource = list;
        }
        private void DeleteBtn_Click(object sender, RoutedEventArgs e)
        {
            var vm = this.DataContext as HISGUISetVM;

            CommClient.RegistrationDitch ditchClient = new CommClient.RegistrationDitch();
            if (ditchClient.DeleteRegistrationDitch(vm.CurrentRegistrationDitch.ID))
            {
                MessageBox.Show("OK");
                newRegistrationDitch();
                updateAllRegistrationDitchList();
            }
            else
            {
                MessageBox.Show("Error");
            }
        }
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            var vm = this.DataContext as HISGUISetVM;

            if (vm.CurrentRegistrationDitch == null)
            {
                return;
            }

            CommClient.RegistrationDitch vistTimeClient = new CommClient.RegistrationDitch();
            vm.CurrentRegistrationDitch.StartTime = this.StartTime.GetMyValue();

            if (bIsEdit == true)
            {
                if (vistTimeClient.UpdateRegistrationDitch(vm.CurrentRegistrationDitch))
                {
                    MessageBox.Show("OK");
                    newRegistrationDitch();
                    updateAllRegistrationDitchList();
                }
                else
                {
                    MessageBox.Show("Error");
                }
            }
            else
            {
                if (vistTimeClient.SaveRegistrationDitch(vm.CurrentRegistrationDitch))
                {
                    MessageBox.Show("OK");
                    newRegistrationDitch();
                    updateAllRegistrationDitchList();
                }
                else
                {
                    MessageBox.Show("Error");
                }
            }
        }