Beispiel #1
0
        public static MaterialDeliveryTableEntity updateMaterialDelivery(MaterialDeliveryTableEntity materialDelivery, dynamic bodyData)
        {
            materialDelivery.delivered_ondate  = bodyData.delivered_ondate;
            materialDelivery.new_delivery_date = ConvertToDate(bodyData.new_delivery_date);
            materialDelivery.tracking_nr       = bodyData.tracking_nr;
            materialDelivery.freight_name      = bodyData.freight_name;

            // Define as done
            materialDelivery.status = MaterialDeliveryConstants.STATUS_DONE;

            return(materialDelivery);
        }
        public async Task <Object> UpdateMaterialDelivery(string guid, dynamic bodyData)
        {
            // Find package, if found - update else fail.
            List <MaterialDeliveryTableEntity> result = await QueryMaterialDeliveryOnGuid(guid);

            if (result.Count == 1)
            {
                MaterialDeliveryTableEntity updatedMaterialDelivery = Mappings.updateMaterialDelivery(result[0], bodyData);
                TableResult tr = await table.InsertorReplace(updatedMaterialDelivery, tableName);

                return(tr.Result);
            }
            else
            {
                return(null);
            }
        }
Beispiel #3
0
 public static MaterialDeliveryEntity ToMaterialDeliveryEntity(this MaterialDeliveryTableEntity packageCheckTableEntity)
 {
     return(new MaterialDeliveryEntity()
     {
         webguid = packageCheckTableEntity.PartitionKey,
         id = packageCheckTableEntity.RowKey,
         vendor_number = packageCheckTableEntity.vendor_number,
         vendor_name = packageCheckTableEntity.vendor_name,
         po = packageCheckTableEntity.po,
         item = packageCheckTableEntity.item,
         material = packageCheckTableEntity.material,
         shorttext = packageCheckTableEntity.shorttext,
         order_qty = packageCheckTableEntity.order_qty,
         order_unit = packageCheckTableEntity.order_unit,
         delivery_date = packageCheckTableEntity.delivery_date,
         delivered_ondate = packageCheckTableEntity.delivered_ondate,
         new_delivery_date = packageCheckTableEntity.new_delivery_date,
         tracking_nr = packageCheckTableEntity.tracking_nr,
         freight_name = packageCheckTableEntity.freight_name,
         status = packageCheckTableEntity.status
     });
 }