Пример #1
0
        /// <summary>
        /// 插入行业信息
        /// </summary>
        /// <param name="entity"></param>
        public async Task InsertCompanyInfoSync(EntityCompany entity)
        {
            var model = new TableCompany();

            entity.FoundedTime = entity.FoundedTime ?? DateTime.Now;
            entity.IssureTime  = entity.IssureTime ?? DateTime.Now;
            model    = Mapper.Map <EntityCompany, TableCompany>(entity);
            model.Id = Utils.GetNewId();
            var companyRep = GetRepositoryInstance <TableCompany>();
            await companyRep.InsertAsync(model);
        }
Пример #2
0
        public async Task UpdateCompanyInfo(EntityCompany entity)
        {
            var model = new TableCompany();

            model    = Mapper.Map <EntityCompany, TableCompany>(entity);
            model.Id = entity.Id;
            var companyRep = GetRepositoryInstance <TableCompany>();

            companyRep.Update <TableCompany>(model, companyInfo => new
            {
                companyInfo.CompanyName,
                companyInfo.Provice,
                companyInfo.ProvCode,
                companyInfo.City,
                companyInfo.CityCode,
                companyInfo.County,
                companyInfo.CountyCode,
                companyInfo.AddressDetail,
                companyInfo.Longitude,
                companyInfo.Latitude,
                companyInfo.Industry,
                companyInfo.Economy,
                companyInfo.CompanyDetail,
                companyInfo.ZipCode,
                companyInfo.FoundedTime,
                companyInfo.IssureTime,
                companyInfo.IndustryCode,
                companyInfo.Owner,
                companyInfo.CompanyScale,
                companyInfo.CompanyIncome,
                companyInfo.ChiefSafeyName,
                companyInfo.ChiefSafeyPhone,
                companyInfo.ViceSafeyName,
                companyInfo.ViceSafeyPhone,
                companyInfo.OnDutyPhone,
                companyInfo.EmergencyPhone,
                companyInfo.RiskLevel
            });
        }
Пример #3
0
 public static TableColumn[] GetColumns(TableCompany table)
 {
     return(new TableColumn[] { table.Version, table.ModifiedAt });
 }
Пример #4
0
 public static AuditData ReadOrdinal(ISqDataRecordReader record, TableCompany table, int offset)
 {
     return(new AuditData(version: table.Version.Read(record, offset), modifiedAt: table.ModifiedAt.Read(record, offset + 1)));
 }
Пример #5
0
 public static AuditData Read(ISqDataRecordReader record, TableCompany table)
 {
     return(new AuditData(version: table.Version.Read(record), modifiedAt: table.ModifiedAt.Read(record)));
 }
Пример #6
0
 public static TableColumn[] GetColumns(TableCompany table)
 {
     return(new TableColumn[] { table.CompanyId, table.CompanyName });
 }
Пример #7
0
 public static CompanyName ReadOrdinal(ISqDataRecordReader record, TableCompany table, int offset)
 {
     return(new CompanyName(id: table.CompanyId.Read(record, offset), name: table.CompanyName.Read(record, offset + 1)));
 }
Пример #8
0
 public static CompanyName Read(ISqDataRecordReader record, TableCompany table)
 {
     return(new CompanyName(id: table.CompanyId.Read(record), name: table.CompanyName.Read(record)));
 }