//
//  CommodityManagementTopView.m
//  ALand
//
//  Created by Z on 16/3/28.
//  Copyright © 2016年 Z. All rights reserved.
//

#import "CommodityManagementTopView.h"
#import "UIView+Category.h"
#import "ManagementViewController.h"
#import "CommodityManagementViewController.h"
#import "AddCommodityViewController.h"
@interface CommodityManagementTopView ()
@property (weak, nonatomic) IBOutlet UIButton *buttonAdd;
@property (weak, nonatomic) IBOutlet UIButton *buttonManagement;


@end
@implementation CommodityManagementTopView


- (void)awakeFromNib {
    self.buttonAdd.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.buttonManagement.imageView.contentMode = UIViewContentModeScaleAspectFit;
}
- (IBAction)managementAct:(id)sender {
    
    ManagementViewController *manageVC = [[ManagementViewController alloc] init];
    [self hideSortView];
    manageVC.isShowNavigationBar = YES;
    manageVC.arrCellData = [self.arrDatas mutableCopy];
    manageVC.isLeft = self.isLeft;
    manageVC.row = self.row;
    
    [[self viewController] PushViewController:manageVC animated:YES];
    
    CLog(@"m");
}
- (IBAction)addAct:(id)sender {
    [self hideSortView];
    AddCommodityViewController *addVC = [[AddCommodityViewController alloc] init];
    addVC.hidesBottomBarWhenPushed = YES;
    
    
    [[self viewController].navigationController pushViewController:addVC animated:YES];
    
    CLog(@"a");
}
- (void)hideSortView {
    CommodityManagementViewController *commodityVC = (CommodityManagementViewController *)[self viewController];
    [commodityVC.sorView hide];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
