Ejemplo n.º 1
0
        public IList<Core.Business.TeachPlanRate> GetAllTeachPlanRate()
        {
            IList<Core.Business.TeachPlanRate> teachPlanRatelist = new List<Core.Business.TeachPlanRate>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllTeachPlanRate);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.TeachPlanRate teachPlanRate = new Core.Business.TeachPlanRate();

                    if (!reader.IsDBNull(0)) teachPlanRate.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) teachPlanRate.Term = reader.GetInt32(1);
                    if (!reader.IsDBNull(2)) teachPlanRate.Week = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) teachPlanRate.LftCode = reader.GetString(3);
                    if (!reader.IsDBNull(4)) teachPlanRate.RgtCode = reader.GetString(4);
                    if (!reader.IsDBNull(5)) teachPlanRate.CheckedDepart = reader.GetString(5);
                    if (!reader.IsDBNull(6)) teachPlanRate.Year = reader.GetString(6);

                    teachPlanRate.MarkOld();
                    teachPlanRatelist.Add(teachPlanRate);
                }
                reader.Close();
            }
            return teachPlanRatelist;
        }
Ejemplo n.º 2
0
        public IList<TeachPlanRate> GetTeachePlanRate(string queryParam)
        {
            if (string.IsNullOrEmpty(queryParam))
            {
                return this.GetAllTeachPlanRate();
            }

            IList<Core.Business.TeachPlanRate> teachPlanRatelist = new List<Core.Business.TeachPlanRate>();

            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Text", SqlDbType.NVarChar, queryParam);

            SqlDataReader reader = sql.ExecuteSqlReader(string.Format(SqlGetTeachPlanRates, queryParam));

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.TeachPlanRate teachPlanRate = new Core.Business.TeachPlanRate();

                    if (!reader.IsDBNull(0)) teachPlanRate.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) teachPlanRate.Term = reader.GetInt32(1);
                    if (!reader.IsDBNull(2)) teachPlanRate.Week = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) teachPlanRate.LftCode = reader.GetString(3);
                    if (!reader.IsDBNull(4)) teachPlanRate.RgtCode = reader.GetString(4);
                    if (!reader.IsDBNull(5)) teachPlanRate.CheckedDepart = reader.GetString(5);
                    if (!reader.IsDBNull(6)) teachPlanRate.Year = reader.GetString(6);

                    teachPlanRate.MarkOld();
                    teachPlanRatelist.Add(teachPlanRate);
                }
                reader.Close();
            }
            return teachPlanRatelist;
        }
Ejemplo n.º 3
0
        public CY.GFive.Core.Business.TeachPlanRate Select(Department department, string year, int term)
        {
            if (department == null || year == "")
            {
                return null;
            }

            IList<Core.Business.TeachPlanRate> teachPlanRatelist = new List<Core.Business.TeachPlanRate>();
            SqlServerUtility sql = new SqlServerUtility();
            string sqlstr = string.Empty;

            sql.AddParameter("@Depart", SqlDbType.NVarChar, department.DepartCode);
            sql.AddParameter("@Year", SqlDbType.NVarChar, year);
            sql.AddParameter("@Term", SqlDbType.Int, term);

            SqlDataReader reader = sql.ExecuteSqlReader(SqlIsExsit);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.TeachPlanRate teachPlanRate = new Core.Business.TeachPlanRate();

                if (!reader.IsDBNull(0)) teachPlanRate.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) teachPlanRate.Term = reader.GetInt32(1);
                if (!reader.IsDBNull(2)) teachPlanRate.Week = reader.GetInt32(2);
                if (!reader.IsDBNull(3)) teachPlanRate.LftCode = reader.GetString(3);
                if (!reader.IsDBNull(4)) teachPlanRate.RgtCode = reader.GetString(4);
                if (!reader.IsDBNull(5)) teachPlanRate.CheckedDepart = reader.GetString(5);
                if (!reader.IsDBNull(6)) teachPlanRate.Year = reader.GetString(6);
                teachPlanRate.MarkOld();

                reader.Close();
                return teachPlanRate;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Ejemplo n.º 4
0
        public Core.Business.TeachPlanRate Select(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectTeachPlanRate);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.TeachPlanRate teachPlanRate = new Core.Business.TeachPlanRate();

                if (!reader.IsDBNull(0)) teachPlanRate.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) teachPlanRate.Term = reader.GetInt32(1);
                if (!reader.IsDBNull(2)) teachPlanRate.Week = reader.GetInt32(2);
                if (!reader.IsDBNull(3)) teachPlanRate.LftCode = reader.GetString(3);
                if (!reader.IsDBNull(4)) teachPlanRate.RgtCode = reader.GetString(4);
                if (!reader.IsDBNull(5)) teachPlanRate.CheckedDepart = reader.GetString(5);
                if (!reader.IsDBNull(6)) teachPlanRate.Year = reader.GetString(6);
                reader.Close();
                return teachPlanRate;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Ejemplo n.º 5
0
        public IList<Core.Business.TeachPlanRate> Search(string year, int term)
        {
            IList<Core.Business.TeachPlanRate> teachPlanRatelist = new List<Core.Business.TeachPlanRate>();
            SqlServerUtility sql = new SqlServerUtility();
            string sqlstr = string.Empty;
            if ((String.IsNullOrEmpty(year) || year == "") && term == 0)
            {
                sqlstr = SqlGetAllTeachPlanRate;

            }
            else if (String.IsNullOrEmpty(year) || year == "")
            {
                sql.AddParameter("@Term", SqlDbType.Int, term);
                sqlstr = SqlSearchByTerm;

            }
            else if (term == 0)
            {
                sql.AddParameter("@Year", SqlDbType.NVarChar, year);
                sqlstr = SqlSearchByYear;
            }
            else
            {
                sql.AddParameter("@Term", SqlDbType.Int, term);
                sql.AddParameter("@Year", SqlDbType.NVarChar, year);
                sqlstr = SqlSearchByYearAndTerm;
            }

            SqlDataReader reader = sql.ExecuteSqlReader(sqlstr);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.TeachPlanRate teachPlanRate = new Core.Business.TeachPlanRate();

                    if (!reader.IsDBNull(0)) teachPlanRate.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) teachPlanRate.Term = reader.GetInt32(1);
                    if (!reader.IsDBNull(2)) teachPlanRate.Week = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) teachPlanRate.LftCode = reader.GetString(3);
                    if (!reader.IsDBNull(4)) teachPlanRate.RgtCode = reader.GetString(4);
                    if (!reader.IsDBNull(5)) teachPlanRate.CheckedDepart = reader.GetString(5);
                    if (!reader.IsDBNull(6)) teachPlanRate.Year = reader.GetString(6);

                    teachPlanRate.MarkOld();
                    teachPlanRatelist.Add(teachPlanRate);
                }
                reader.Close();
            }
            return teachPlanRatelist;
        }
Ejemplo n.º 6
0
        public Core.Business.TeachPlanRate GetTP(string lcode, string rcode)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@LftCode", SqlDbType.NVarChar, lcode);
            sql.AddParameter("@RgtCode", SqlDbType.NVarChar, rcode);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetByLAndR);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.TeachPlanRate teachPlanRate = new Core.Business.TeachPlanRate();

                if (!reader.IsDBNull(0)) teachPlanRate.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) teachPlanRate.Term = reader.GetInt32(1);
                if (!reader.IsDBNull(2)) teachPlanRate.Week = reader.GetInt32(2);
                if (!reader.IsDBNull(3)) teachPlanRate.LftCode = reader.GetString(3);
                if (!reader.IsDBNull(4)) teachPlanRate.RgtCode = reader.GetString(4);
                if (!reader.IsDBNull(5)) teachPlanRate.CheckedDepart = reader.GetString(5);
                if (!reader.IsDBNull(6)) teachPlanRate.Year = reader.GetString(6);
                teachPlanRate.MarkOld();
                reader.Close();
                return teachPlanRate;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }