public void Save(Department model) { if (model == null) { throw new ArgumentException("department.Name is null"); } if (model.ID > 0) { dao.Update(model); } else { dao.Add(model); } Core.AccountManager.RefreshCache(); }
/// <summary> /// 添加部门 记得指定部门所属企业编号EID /// </summary> /// <param name="dp"></param> /// <returns>添加成功返回当前部门编号 否则返回-1</returns> public int Add(Department dp) { return(ddao.Add(dp)); }
/// <summary> /// 添加部门 /// </summary> /// <param name="model"></param> /// <returns>添加成功返回当前部门编号 否则返回-1</returns> public int AddDepartment(Department model) { return(dadao.Add(model)); }