public List <TableDraftee> Convert(DataTable source)
        {
            List <TableDraftee> result = new List <TableDraftee>(source.Rows.Count);

            foreach (DataRow dataRow in source.Rows)
            {
                TableDraftee tableDraftee = new TableDraftee();
                tableDraftee.Id       = (long)dataRow["id"];
                tableDraftee.FullName = DbConverterUtils.ConvertString(dataRow["full_name"]);
                tableDraftee.Year     = DbConverterUtils.ConvertLong(dataRow["birth_year"]);
                result.Add(tableDraftee);
            }
            return(result);
        }
示例#2
0
        public List <Relative> Convert(DataTable source)
        {
            List <Relative> result = new List <Relative>(source.Rows.Count);

            foreach (DataRow dataRow in source.Rows)
            {
                Relative relative = new Relative();
                relative.Id               = (long)dataRow["id"];
                relative.DrafteeId        = (long)dataRow["draftee_id"];
                relative.RelationshipType = DbConverterUtils.ConvertString(dataRow["relationship_type"]);
                relative.FullName         = DbConverterUtils.ConvertString(dataRow["full_name"]);
                relative.BirthYear        = DbConverterUtils.ConvertInt(dataRow["birth_year"]);
                relative.BirthPlace       = DbConverterUtils.ConvertString(dataRow["birth_place"]);
                relative.WorkPlace        = DbConverterUtils.ConvertString(dataRow["work_place"]);
                result.Add(relative);
            }
            return(result);
        }
示例#3
0
        public List <EducationPlace> Convert(DataTable source)
        {
            List <EducationPlace> result = new List <EducationPlace>(source.Rows.Count);

            foreach (DataRow dataRow in source.Rows)
            {
                EducationPlace educationPlace = new EducationPlace();
                educationPlace.Id              = (long)dataRow["id"];
                educationPlace.DrafteeId       = (long)dataRow["draftee_id"];
                educationPlace.Name            = DbConverterUtils.ConvertString(dataRow["name"]);
                educationPlace.Education       = DbConverterUtils.ConvertString(dataRow["education"]);
                educationPlace.InstitutionType = DbConverterUtils.ConvertString(dataRow["institution_type"]);
                educationPlace.EndDate         = DbConverterUtils.ConvertDateTime(dataRow["end_date"]);
                educationPlace.Faculty         = DbConverterUtils.ConvertString(dataRow["faculty"]);
                educationPlace.Specialty       = DbConverterUtils.ConvertString(dataRow["specialty"]);
                result.Add(educationPlace);
            }
            return(result);
        }
        public Address Convert(DataTable source)
        {
            if (source == null || source.Rows.Count < 1)
            {
                return(null);
            }
            DataRow dataRow = source.Rows[0];
            Address result  = new Address();

            result.DrafteeId         = (long)dataRow["draftee_id"];
            result.MunicipalDistrict = DbConverterUtils.ConvertString(dataRow["municipal_district"]);
            result.MailIndex         = DbConverterUtils.ConvertString(dataRow["mail_index"]);
            result.StreetName        = DbConverterUtils.ConvertString(dataRow["street_name"]);
            result.HouseNumber       = DbConverterUtils.ConvertString(dataRow["house_number"]);
            result.HousingNumber     = DbConverterUtils.ConvertString(dataRow["housing_number"]);
            result.Apartment         = DbConverterUtils.ConvertString(dataRow["apartment"]);
            result.HomePhone         = DbConverterUtils.ConvertString(dataRow["home_phone"]);
            return(result);
        }
        public Draftee Convert(DataTable source)
        {
            if (source == null || source.Rows.Count < 1)
            {
                return(null);
            }
            DataRow dataRow = source.Rows[0];
            Draftee draftee = new Draftee();

            draftee.Id               = (long)dataRow["id"];
            draftee.LastName         = DbConverterUtils.ConvertString(dataRow["last_name"]);
            draftee.FirstName        = DbConverterUtils.ConvertString(dataRow["first_name"]);
            draftee.Patronymic       = DbConverterUtils.ConvertString(dataRow["patronymic"]);
            draftee.BirthDate        = DbConverterUtils.ConvertDateTime(dataRow["birth_date"]);
            draftee.BirthPlace       = DbConverterUtils.ConvertString(dataRow["birth_place"]);
            draftee.Category         = DbConverterUtils.ConvertString(dataRow["category"]);
            draftee.TroopType        = DbConverterUtils.ConvertString(dataRow["troop_type"]);
            draftee.ForeignLanguages = DbConverterUtils.ConvertString(dataRow["foreign_languages"]);
            return(draftee);
        }
        public List <Draftee> Convert(DataTable source)
        {
            List <Draftee> result = new List <Draftee>(source.Rows.Count);

            foreach (DataRow dataRow in source.Rows)
            {
                Draftee draftee = new Draftee();
                draftee.Id               = (long)dataRow["id"];
                draftee.LastName         = DbConverterUtils.ConvertString(dataRow["last_name"]);
                draftee.FirstName        = DbConverterUtils.ConvertString(dataRow["first_name"]);
                draftee.Patronymic       = DbConverterUtils.ConvertString(dataRow["patronymic"]);
                draftee.BirthDate        = DbConverterUtils.ConvertDateTime(dataRow["birth_date"]);
                draftee.BirthPlace       = DbConverterUtils.ConvertString(dataRow["birth_place"]);
                draftee.Category         = DbConverterUtils.ConvertString(dataRow["category"]);
                draftee.TroopType        = DbConverterUtils.ConvertString(dataRow["troop_type"]);
                draftee.ForeignLanguages = DbConverterUtils.ConvertString(dataRow["foreign_languages"]);
                result.Add(draftee);
            }
            return(result);
        }
示例#7
0
        public Document Convert(DataTable source)
        {
            if (source == null || source.Rows.Count < 1)
            {
                return(null);
            }
            DataRow  dataRow = source.Rows[0];
            Document result  = new Document();

            result.DrafteeId            = (long)dataRow["draftee_id"];
            result.PassportSeries       = DbConverterUtils.ConvertString(dataRow["passport_series"]);
            result.PassportNumber       = DbConverterUtils.ConvertString(dataRow["passport_number"]);
            result.PassportIssueDate    = DbConverterUtils.ConvertDateTime(dataRow["passport_issue_date"]);
            result.PassportIssuedBy     = DbConverterUtils.ConvertString(dataRow["passport_issued_by"]);
            result.CertificateSeries    = DbConverterUtils.ConvertString(dataRow["certificate_series"]);
            result.CertificateNumber    = DbConverterUtils.ConvertString(dataRow["certificate_number"]);
            result.CertificateIssueDate = DbConverterUtils.ConvertDateTime(dataRow["certificate_issue_date"]);
            result.TicketSeries         = DbConverterUtils.ConvertString(dataRow["ticket_series"]);
            result.TicketNumber         = DbConverterUtils.ConvertString(dataRow["ticket_number"]);
            result.TicketIssueDate      = DbConverterUtils.ConvertDateTime(dataRow["ticket_issue_date"]);
            return(result);
        }