示例#1
0
        private async void CreateButton_Clicked(object sender, RoutedEventArgs e)
        {
            string name       = Name.Text;
            string date       = Birthday.Date.Year + "-" + Birthday.Date.Month + "-" + Birthday.Date.Day;
            string location   = Location.Text;
            string health     = Health.Text;
            string sex        = ((ComboBoxItem)SexSelect.SelectedItem).Content.ToString();
            string department = ((Department)DeptSelect.SelectedItem).Dname;
            bool   isSuccess  = await employeeViewModel.CreateItem(name, date, sex, location, health, department);

            if (isSuccess)
            {
                Frame.Navigate(typeof(EmployeePage));
            }
            else
            {
                showDialog("添加失败");
            }
        }