public DepartmentInfo GetDepartmentInfoByDepartmentCode(string departmentCode)
        {
            DepartmentInfo departmentInfo = new DepartmentInfo();

            DepartmentDal dal = new DepartmentDal();

            DataSet ds = dal.GetDepartmentInfoByDepartmentCode(departmentCode);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                departmentInfo = ConvertToModel(ds.Tables[0].Rows[0]);
            }

            return departmentInfo;
        }
        public DepartmentInfo GetDepartmentById(int departmentId)
        {
            DepartmentInfo departmentInfo = new DepartmentInfo();

            DepartmentDal dal = new DepartmentDal();

            DataSet ds = dal.GetDepartmentById(departmentId);

            if(ds!=null &&ds.Tables.Count>0&&ds.Tables[0].Rows.Count>0)
            {
                departmentInfo = ConvertToModel(ds.Tables[0].Rows[0]);
            }

            return departmentInfo;
        }
 public DataSet GetDepartmentList(string departmentCodeOrName, int parentDepartmentId)
 {
     DepartmentDal dal = new DepartmentDal();
     return dal.GetDepartmentList(departmentCodeOrName, parentDepartmentId);
 }
 public DataSet GetAllDepartment()
 {
     DepartmentDal dal = new DepartmentDal();
     return dal.GetAllDepartment();
 }
 public void DeleteById(int departmentId)
 {
     DepartmentDal dal = new DepartmentDal();
     dal.DeleteById(departmentId);
 }
        public void AddDepartment(DepartmentInfo departmentInfo)
        {
            DepartmentDal dal = new DepartmentDal();

            dal.AddDepartment(departmentInfo);
        }
        public void Update(DepartmentInfo departmentInfo)
        {
            DepartmentDal dal = new DepartmentDal();

            dal.Update(departmentInfo);
        }