示例#1
0
        public override void ParseData(AmwSqlDataReaderWrapper reader)
        {
            base.ParseData(reader);

            Name = reader.GetValueIfExisits <string>(nameof(Name));
            Tel  = reader.GetValueIfExisits <string>(nameof(Tel));
        }
        public override void ParseData(AmwSqlDataReaderWrapper reader)
        {
            base.ParseData(reader);

            noHash   = true;
            Login    = reader.GetValueIfExisits <string>(nameof(Login));
            Password = reader.GetValueIfExisits <string>(nameof(Password));
        }
        public override void ParseData(AmwSqlDataReaderWrapper reader)
        {
            base.ParseData(reader);

            FullName       = reader.GetValueIfExisits <string>(nameof(FullName));
            Tel            = reader.GetValueIfExisits <string>(nameof(Tel));
            Experince      = reader.GetValueIfExisits <int>(nameof(Experince));
            EducationLevel = reader.GetValueIfExisits <string>(nameof(EducationLevel));
        }
        public static T GetValueIfExisits <T>(this AmwSqlDataReaderWrapper reader, string column)
        {
            //Check if the query has been run before
            if (queryColumns.ContainsKey(reader.QueryText))
            {
                if (queryColumns[reader.QueryText].Contains(column))
                {
                    try
                    {
                        return((T)reader.Reader[column]);
                    }
                    catch (System.Exception ex)
                    {
                        log.Error("Unable to cast object", ex);
                    }
                }
            }
            else
            {
                queryColumns.Add(reader.QueryText, new List <string>());

                for (int i = 0; i < reader.Reader.FieldCount; i++)
                {
                    queryColumns[reader.QueryText].Add(reader.Reader.GetName(i));
                }

                return(reader.GetValueIfExisits <T>(column));
            }
            return(default);
示例#5
0
        public override void ParseData(AmwSqlDataReaderWrapper reader)
        {
            base.ParseData(reader);

            if (reader.HasRows)
            {
                Level = reader.GetValueIfExisits <string>(nameof(Level));
            }
        }
示例#6
0
        public override void ParseData(AmwSqlDataReaderWrapper reader)
        {
            base.ParseData(reader);

            if (reader.Reader.HasRows)
            {
                Title           = reader.GetValueIfExisits <string>(nameof(Title));
                EducationLevel  = reader.GetValueIfExisits <string>(nameof(EducationLevel));
                ExperienceYears = reader.GetValueIfExisits <int>(nameof(ExperienceYears));
                Salery          = reader.GetValueIfExisits <int>(nameof(Salery));
                CompanyId       = reader.GetValueIfExisits <int>(nameof(CompanyId));
                CompanyName     = reader.GetValueIfExisits <string>(nameof(CompanyName));
            }
        }