ShopCartItemModel.m 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // WorkFlowInfoModel.m
  3. // IBOSS
  4. //
  5. // Created by iHope on 14-7-9.
  6. // Copyright (c) 2014年 elongtian. All rights reserved.
  7. //
  8. #import "ShopCartItemModel.h"
  9. @implementation ShopCartItemModel
  10. -(void)parseDic:(NSDictionary *)dic
  11. {
  12. if(dic!=nil){
  13. int decimalPlaces = [[dic objectForKey:@"DecimalPlaces"] intValue];
  14. NSString *str = [NSString stringWithFormat:@"%@%d%@",@"%.",decimalPlaces,@"f"];
  15. int cartIdValue= [[dic objectForKey:@"CartID"]intValue];
  16. _cartId= [NSString stringWithFormat:@"%d",cartIdValue];
  17. NSInteger inventoryIdValue= [[dic objectForKey:@"InventoryID"]integerValue];
  18. _inventoryId= [NSString stringWithFormat:@"%ld",(long)inventoryIdValue];
  19. double salesQuantityValue= [[dic objectForKey:@"SalesQuantity"]doubleValue];
  20. _salesQuantity= [NSString stringWithFormat:str,salesQuantityValue];
  21. double salesPriceValue= [[dic objectForKey:@"SalesPrice"]doubleValue];
  22. _salesPrice=[NSString stringWithFormat:@"%lf",salesPriceValue];
  23. double markedPriceValue= [[dic objectForKey:@"MarkedPrice"]doubleValue];
  24. _markedPrice=[NSString stringWithFormat:@"%lf",markedPriceValue];
  25. _remarks=[dic objectForKey:@"Remarks"]==nil?@"":[dic objectForKey:@"Remarks"];
  26. _specification=[dic objectForKey:@"Specification"];
  27. double acreageValue= [[dic objectForKey:@"Acreage"]doubleValue];
  28. _acreage=[NSString stringWithFormat:@"%lf",acreageValue];
  29. double volumeValue=[[dic objectForKey:@"Volume"]doubleValue];
  30. _volume=[NSString stringWithFormat:@"%lf",volumeValue];
  31. int codeIdValue= [[dic objectForKey:@"CodeID"]intValue];
  32. _codeId=[NSString stringWithFormat:@"%d",codeIdValue];
  33. _code=[dic objectForKey:@"Code"];
  34. _onlyCode=[dic objectForKey:@"OnlyCode"];
  35. int gradeIdValue= [[dic objectForKey:@"GradeID"]intValue];
  36. _gradeId=[NSString stringWithFormat:@"%d",gradeIdValue];
  37. _colorNumber=[dic objectForKey:@"ColorNumber"];
  38. int warehouseIdValue= [[dic objectForKey:@"WarehouseID"]intValue];
  39. _warehouseId=[NSString stringWithFormat:@"%d",warehouseIdValue];
  40. _positionNumber=[dic objectForKey:@"PositionNumber"];
  41. _warehouseName=[dic objectForKey:@"WarehouseName"];
  42. double balanceQuantityValue= [[dic objectForKey:@"BalanceQuantity"]doubleValue];
  43. _balanceQuantity = [NSString stringWithFormat:str,balanceQuantityValue];
  44. _brandId=[dic objectForKey:@"BrandID"];
  45. _brandName=[dic objectForKey:@"BrandName"];
  46. _kindId=[dic objectForKey:@"KindID"];
  47. _kindName=[dic objectForKey:@"KindName"];
  48. _varietyId=[dic objectForKey:@"VarietyID"];
  49. _varietyName=[dic objectForKey:@"VarietyName"];
  50. _seriesId=[dic objectForKey:@"SeriesID"];
  51. _seriesName=[dic objectForKey:@"SeriesName"];
  52. _unitId=[dic objectForKey:@"UnitID"];
  53. _unitName=[dic objectForKey:@"UnitName"];
  54. _gradeName=[dic objectForKey:@"GradeName"];
  55. _package=[dic objectForKey:@"Package"];
  56. _weight=[dic objectForKey:@"Weight"];
  57. _decimalPlaces=[[dic objectForKey:@"DecimalPlaces"]integerValue];
  58. _circulateType=[[dic objectForKey:@"CirculateType" ]integerValue];
  59. _isChecked=YES;
  60. }
  61. }
  62. @end