//
//  OrderInformationTableViewCell.m
//  Lighting
//
//  Created by 曹云霄 on 16/5/4.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "OrderInformationTableViewCell.h"

@implementation OrderInformationTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


#pragma mark -订单赋值
- (void)setModel:(OrderBill *)model
{
    _model = model;
    self.orderNumber.text = _model.order.orderNumber;
    self.orderTime.text = [self dateAsString:_model.order.orderTime];
    self.orderStatus.text = _model.order.orderState;
    self.operatorName.text = _model.employee.userName;
}



#pragma mark -时间转换NSDate转NSString
- (NSString*)dateAsString:(NSDate*)date {
    
    NSDateFormatter *formatter=[[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    NSString * timeString = [formatter stringFromDate:date];
    return timeString;
    
}




- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
