예제 #1
0
        // FIX THIS::::
        private static MaterialDeliveryEntity castFromBodyData(dynamic bodyData)
        {
            MaterialDeliveryEntity returnEntity = new MaterialDeliveryEntity();


            returnEntity.delivered_ondate = bodyData.delivered_ondate;
            if (Convert.ToString(bodyData.new_delivery_date) != "")
            {
                returnEntity.new_delivery_date = DateTime.Parse(Convert.ToString(bodyData.new_delivery_date));
            }
            returnEntity.tracking_nr  = bodyData.tracking_nr;
            returnEntity.freight_name = bodyData.freight_name;

            return(returnEntity);
        }
예제 #2
0
        private static MaterialDeliveryEntity castInsertDeliveryFromBodyData(dynamic bodyData)
        {
            MaterialDeliveryEntity returnEntity = new MaterialDeliveryEntity();

            returnEntity.vendor_number = bodyData.vendor_number;
            returnEntity.vendor_name   = bodyData.vendor_name;
            returnEntity.po            = bodyData.po;
            returnEntity.item          = bodyData.item;
            returnEntity.material      = bodyData.material;
            returnEntity.shorttext     = bodyData.shorttext;
            returnEntity.order_qty     = bodyData.order_qty;
            returnEntity.order_unit    = bodyData.order_unit;
            returnEntity.delivery_date = ConvertToDate(bodyData.delivery_date);

            return(returnEntity);
        }
예제 #3
0
        public static List <MaterialDeliveryEntity> getMaterialDeliveryEntities(dynamic bodyData)
        {
            List <MaterialDeliveryEntity> MaterialDelivieres = new List <MaterialDeliveryEntity>();

            string newWebGuid = Guid.NewGuid().ToString();

            foreach (var element in bodyData)
            {
                MaterialDeliveryEntity tmpEnt = castInsertDeliveryFromBodyData(element);

                tmpEnt.webguid = newWebGuid;

                MaterialDelivieres.Add(tmpEnt);
            }

            return(MaterialDelivieres);
        }
예제 #4
0
 public static MaterialDeliveryTableEntity ToMaterialDeliveryTableEntity(this MaterialDeliveryEntity materialDeliveryEntry)
 {
     return(new MaterialDeliveryTableEntity()
     {
         PartitionKey = materialDeliveryEntry.webguid,
         RowKey = materialDeliveryEntry.id,
         vendor_number = materialDeliveryEntry.vendor_number,
         vendor_name = materialDeliveryEntry.vendor_name,
         po = materialDeliveryEntry.po,
         item = materialDeliveryEntry.item,
         material = materialDeliveryEntry.material,
         shorttext = materialDeliveryEntry.shorttext,
         order_qty = materialDeliveryEntry.order_qty,
         order_unit = materialDeliveryEntry.order_unit,
         delivery_date = materialDeliveryEntry.delivery_date,
         delivered_ondate = materialDeliveryEntry.delivered_ondate,
         new_delivery_date = materialDeliveryEntry.new_delivery_date,
         tracking_nr = materialDeliveryEntry.tracking_nr,
         freight_name = materialDeliveryEntry.freight_name,
         status = materialDeliveryEntry.status
     });
 }