public static PackageCheckTableEntity updatePackageCheck(PackageCheckTableEntity package, dynamic bodyData) { //PackageCheckEntity tmpPack = new PackageCheckEntity(); // Define and handle fields.. package.ProcessedTime = DateTime.Parse(Convert.ToString(bodyData.ProcessedTime)); package.LCI = bodyData.LCI; package.SAP = bodyData.SAP; package.ProcoSys = bodyData.ProcoSys; package.Status = bodyData.Status; return(package); }
public static PackageCheckEntity ToPackageCheckEntity(this PackageCheckTableEntity packageCheckTableEntity) { return(new PackageCheckEntity() { Id = packageCheckTableEntity.RowKey, PackageId = packageCheckTableEntity.PackageId, InstCode = packageCheckTableEntity.InstCode, EntryTime = packageCheckTableEntity.EntryTime, ProcessedTime = packageCheckTableEntity.ProcessedTime, LCI = packageCheckTableEntity.LCI, SAP = packageCheckTableEntity.SAP, ProcoSys = packageCheckTableEntity.ProcoSys, RunType = packageCheckTableEntity.RunType, Status = packageCheckTableEntity.Status }); }
public async Task <Boolean> UpdatePackage(dynamic bodyData) { // Find package, if found - update else fail. List <PackageCheckTableEntity> result = await QueryPacakgeId(Convert.ToString(bodyData.Id)); if (result.Count == 1) { PackageCheckTableEntity updatedPackage = Mappings.updatePackageCheck(result[0], bodyData); TableResult tr = await table.InsertorReplace(updatedPackage, tableName); return(true); } else { return(false); } }