Exemple #1
0
        public async Task SaveData(Base_Department theData)
        {
            if (theData.Id.IsNullOrEmpty())
            {
                theData.InitEntity();

                await _departmentBus.AddDataAsync(theData);
            }
            else
            {
                await _departmentBus.UpdateDataAsync(theData);
            }
        }
Exemple #2
0
        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()));
        }