Beispiel #1
0
        /// <summary>
        /// 获得数据List
        /// </summary>
        public LeaveTypeArray GetLeaveTypesDataList()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * FROM VIEW_LeaveMgr_AllLeaveTypes");
            DataTable      dt   = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql.ToString()).Tables[0];
            LeaveTypeArray list = new LeaveTypeArray();

            foreach (DataRow dr in dt.Rows)
            {
                LeaveType _LeaveMgr_LeaveType = new LeaveType();
                LeaveTypeDataRowToModel(_LeaveMgr_LeaveType, dr);
                list.Add(_LeaveMgr_LeaveType);
            }
            return(list);
        }
Beispiel #2
0
        /// <summary>
        /// 获得数据List
        /// </summary>
        public LeaveTypeArray GetLeaveTypeDataList(string strTypeName)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * FROM VIEW_LeaveMgr_AllLeaveTypes where strTypeName like @strTypeName");
            SqlParameter[] sqlParams =
            {
                new SqlParameter("strTypeName", "%" + strTypeName + "%")
            };
            DataTable      dt   = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql.ToString(), sqlParams).Tables[0];
            LeaveTypeArray list = new LeaveTypeArray();

            if (dt.Rows.Count > 0)
            {
                LeaveType _LeaveMgr_LeaveType = new LeaveType();
                LeaveTypeDataRowToModel(_LeaveMgr_LeaveType, dt.Rows[0]);
                list.Add(_LeaveMgr_LeaveType);
            }
            return(list);
        }