public string Add(Department entity)
 {
     try
     {
         controlText = IsDepartmentComplete(entity);
         if (controlText != "")
         {
             return(controlText);
         }
         return(departmentDal.Add(entity));
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
示例#2
0
        //学院
        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();
        }
示例#3
0
 /// <summary>
 /// 添加部门
 /// </summary>
 /// <param name="department"></param>
 public void AddDepartment(Department department)
 {
     _departmentDal.Add(department);
 }
示例#4
0
 /// <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));
 }
示例#5
0
 /// <summary>
 /// 批量新建部门
 /// </summary>
 /// <param name="departmentList">部门实体对象集合</param>
 /// <returns>返回处理后的部门实体对象集合</returns>
 public static IList <Department> AddDepartment(IList <Department> departmentList)
 {
     return(DepartmentDal.Add(departmentList));
 }
示例#6
0
 /// <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));
 }
示例#7
0
 /// <summary>
 /// 新建部门
 /// </summary>
 /// <param name="department">部门实体对象</param>
 /// <returns>返回处理后的部门实体对象</returns>
 public static Department AddDepartment(Department department)
 {
     return(DepartmentDal.Add(department));
 }
示例#8
0
 /// <summary>
 /// 添加部门
 /// </summary>
 /// <returns></returns>
 public int Add(Department d)
 {
     return(dal.Add(d));
 }