/// <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); }
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 }); }
public static TableColumn[] GetColumns(TableCompany table) { return(new TableColumn[] { table.Version, table.ModifiedAt }); }
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))); }
public static AuditData Read(ISqDataRecordReader record, TableCompany table) { return(new AuditData(version: table.Version.Read(record), modifiedAt: table.ModifiedAt.Read(record))); }
public static TableColumn[] GetColumns(TableCompany table) { return(new TableColumn[] { table.CompanyId, table.CompanyName }); }
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))); }
public static CompanyName Read(ISqDataRecordReader record, TableCompany table) { return(new CompanyName(id: table.CompanyId.Read(record), name: table.CompanyName.Read(record))); }