public async Task SaveData(Base_Department theData) { if (theData.Id.IsNullOrEmpty()) { theData.InitEntity(); await _departmentBus.AddDataAsync(theData); } else { await _departmentBus.UpdateDataAsync(theData); } }
public ActionResult <AjaxResult> SaveData(Base_Department theData) { AjaxResult res; if (theData.Id.IsNullOrEmpty()) { theData.InitEntity(); res = _departmentBus.AddData(theData); } else { res = _departmentBus.UpdateData(theData); } return(JsonContent(res.ToJson())); }