Exemplo n.º 1
0
        public IList<Core.Business.StdCredentials> GetAllStdCredentials()
        {
            IList<Core.Business.StdCredentials> stdCredentialslist = new List<Core.Business.StdCredentials>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllStdCredentials);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.StdCredentials stdCredentials = new Core.Business.StdCredentials();

                    if (!reader.IsDBNull(0)) stdCredentials.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) stdCredentials.InitialDate = reader.GetDateTime(1);
                    if (!reader.IsDBNull(2)) stdCredentials.CertDate = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) stdCredentials.FirstCheckDate = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) stdCredentials.SecondCheckDate = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) stdCredentials.StartDate = reader.GetDateTime(5);
                    if (!reader.IsDBNull(6)) stdCredentials.StopDate = reader.GetDateTime(6);
                    if (!reader.IsDBNull(7)) stdCredentials.IsContinue = reader.GetBoolean(7);
                    if (!reader.IsDBNull(8)) stdCredentials.PraticeScore = reader.GetDecimal(8);
                    if (!reader.IsDBNull(9)) stdCredentials.StdCode = reader.GetString(9);
                    if (!reader.IsDBNull(10)) stdCredentials.ProjectCode = reader.GetString(10);
                    if (!reader.IsDBNull(11)) stdCredentials.CredentialCode = reader.GetString(11);
                    if (!reader.IsDBNull(12)) stdCredentials.CredentialCate = reader.GetString(12);
                    if (!reader.IsDBNull(13)) stdCredentials.CredentialIdentity = reader.GetString(13);
                    if (!reader.IsDBNull(14)) stdCredentials.PracticeProject = reader.GetString(14);
                    if (!reader.IsDBNull(15)) stdCredentials.CertUnit = reader.GetString(15);
                    if (!reader.IsDBNull(16)) stdCredentials.TheoryScore = reader.GetString(16);
                    if (!reader.IsDBNull(17)) stdCredentials.Remark3 = reader.GetString(17);
                    if (!reader.IsDBNull(18)) stdCredentials.Remark4 = reader.GetString(18);
                    if (!reader.IsDBNull(19)) stdCredentials.TrainUnit = reader.GetString(19);
                    if (!reader.IsDBNull(20)) stdCredentials.CheckRcd1 = reader.GetString(20);
                    if (!reader.IsDBNull(21)) stdCredentials.CheckRcd2 = reader.GetString(21);
                    if (!reader.IsDBNull(22)) stdCredentials.IsChecked = reader.GetString(22);
                    if (!reader.IsDBNull(23)) stdCredentials.FirstCheckTrain = reader.GetString(23);
                    if (!reader.IsDBNull(24)) stdCredentials.SecondCheckTrain = reader.GetString(24);

                    stdCredentials.MarkOld();
                    stdCredentialslist.Add(stdCredentials);
                }
                reader.Close();
            }
            return stdCredentialslist;
        }
Exemplo n.º 2
0
        public Core.Business.StdCredentials Select(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();

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

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

                if (!reader.IsDBNull(0)) stdCredentials.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) stdCredentials.InitialDate = reader.GetDateTime(1);
                if (!reader.IsDBNull(2)) stdCredentials.CertDate = reader.GetDateTime(2);
                if (!reader.IsDBNull(3)) stdCredentials.FirstCheckDate = reader.GetDateTime(3);
                if (!reader.IsDBNull(4)) stdCredentials.SecondCheckDate = reader.GetDateTime(4);
                if (!reader.IsDBNull(5)) stdCredentials.StartDate = reader.GetDateTime(5);
                if (!reader.IsDBNull(6)) stdCredentials.StopDate = reader.GetDateTime(6);
                if (!reader.IsDBNull(7)) stdCredentials.IsContinue = reader.GetBoolean(7);
                if (!reader.IsDBNull(8)) stdCredentials.PraticeScore = reader.GetDecimal(8);
                if (!reader.IsDBNull(9)) stdCredentials.StdCode = reader.GetString(9);
                if (!reader.IsDBNull(10)) stdCredentials.ProjectCode = reader.GetString(10);
                if (!reader.IsDBNull(11)) stdCredentials.CredentialCode = reader.GetString(11);
                if (!reader.IsDBNull(12)) stdCredentials.CredentialCate = reader.GetString(12);
                if (!reader.IsDBNull(13)) stdCredentials.CredentialIdentity = reader.GetString(13);
                if (!reader.IsDBNull(14)) stdCredentials.PracticeProject = reader.GetString(14);
                if (!reader.IsDBNull(15)) stdCredentials.CertUnit = reader.GetString(15);
                if (!reader.IsDBNull(16)) stdCredentials.TheoryScore = reader.GetString(16);
                if (!reader.IsDBNull(17)) stdCredentials.Remark3 = reader.GetString(17);
                if (!reader.IsDBNull(18)) stdCredentials.Remark4 = reader.GetString(18);
                if (!reader.IsDBNull(19)) stdCredentials.TrainUnit = reader.GetString(19);
                if (!reader.IsDBNull(20)) stdCredentials.CheckRcd1 = reader.GetString(20);
                if (!reader.IsDBNull(21)) stdCredentials.CheckRcd2 = reader.GetString(21);
                if (!reader.IsDBNull(22)) stdCredentials.IsChecked = reader.GetString(22);
                if (!reader.IsDBNull(23)) stdCredentials.FirstCheckTrain = reader.GetString(23);
                if (!reader.IsDBNull(24)) stdCredentials.SecondCheckTrain = reader.GetString(24);
                reader.Close();
                return stdCredentials;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }