private async void Sb_AddOrUpdate_Click(object sender, EventArgs e)
        {
            if (!Dvp_Validate.Validate())
            {
                return;
            }
            var employee = new Employee
            {
                EmployeeName = Te_Name.Text,
                Age          = Convert.ToInt32(Te_Age.EditValue),
                BirthDay     = De_BirthDay.DateTime,
                Contact      = Te_Contact.Text,
                DepartmentId = Guid.Parse(Lue_Department.EditValue.ToString()),
                Sex          = Rg_Sex.SelectedIndex == 1,
            };

            try
            {
                JsonMessageResult message;
                if (_addOrUpdate)
                {
                    message = await _api.CreateEmployee(employee);
                }
                else
                {
                    employee.Id = Id;
                    message     = await _api.UpdateEmployee(employee);
                }

                if (message.ResultCode != 1)
                {
                    XtraMessageBox.Show("修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    CloseForm();
                    return;
                }

                XtraMessageBox.Show(message.ResultMessage, "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                CloseForm();
            }
            catch (Exception exception)
            {
                XtraMessageBox.Show(exception.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                CloseForm();
            }
        }
        public async Task <IActionResult> Create(CreateEmployeeViewModel model)
        {
            if (ModelState.IsValid)
            {
                var task = await employeeTaskAPI.GetEmployeeTaskById(model.EmployeeTasksId);

                EmployeeTask t = new EmployeeTask()
                {
                    Name       = task.Name,
                    StartTime  = task.StartTime,
                    Dealine    = task.Dealine,
                    EmployeeId = model.Id,
                    Id         = task.Id
                };
                model.EmployeeTasks.Add(t);
                // save
                await employeeAPI.CreateEmployee(model);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(model));
        }