public string Add(Department entity) { try { controlText = IsDepartmentComplete(entity); if (controlText != "") { return(controlText); } return(departmentDal.Add(entity)); } catch (Exception ex) { return(ex.Message); } }
//学院 static void GenerateDepartment(int num) { DepartmentDal dal = new DepartmentDal(); DbSession dbSession = new DbSession(); for (int i = 0; i < num; i++) { Department major = new Department(); major.DepartmentName = "Department_____" + i.ToString(); major.ModfiedOn = Convert.ToDateTime(Faker.Business.CreditCardExpiryDate()); major.CreateTime = major.ModfiedOn.Value.AddMonths(-3); major.Status = Faker.Boolean.Next() ? (short)1 : (short)0; dal.Add(major); } dbSession.SaveChanges(); }
/// <summary> /// 添加部门 /// </summary> /// <param name="department"></param> public void AddDepartment(Department department) { _departmentDal.Add(department); }
/// <summary> /// 批量新建部门 /// </summary> /// <param name="departmentList">部门实体对象集合</param> /// <param name="tran">中间事务对象</param> /// <returns>返回处理后的部门实体对象集合</returns> public static IList <Department> AddDepartment(IList <Department> departmentList, ICTransaction tran) { return(DepartmentDal.Add(departmentList, tran)); }
/// <summary> /// 批量新建部门 /// </summary> /// <param name="departmentList">部门实体对象集合</param> /// <returns>返回处理后的部门实体对象集合</returns> public static IList <Department> AddDepartment(IList <Department> departmentList) { return(DepartmentDal.Add(departmentList)); }
/// <summary> /// 新建部门 /// </summary> /// <param name="department">部门实体对象</param> /// <param name="tran">中间事务对象</param> /// <returns>返回处理后的部门实体对象</returns> public static Department AddDepartment(Department department, ICTransaction tran) { return(DepartmentDal.Add(department, tran)); }
/// <summary> /// 新建部门 /// </summary> /// <param name="department">部门实体对象</param> /// <returns>返回处理后的部门实体对象</returns> public static Department AddDepartment(Department department) { return(DepartmentDal.Add(department)); }
/// <summary> /// 添加部门 /// </summary> /// <returns></returns> public int Add(Department d) { return(dal.Add(d)); }