//
//  UserInfoViewController.m
//  Macalline
//
//  Created by JianjiYuan on 14-12-11.
//  Copyright (c) 2014年 JianjiYuan. All rights reserved.
//

#import "UserInfoViewController.h"

@interface UserInfoViewController ()<UITableViewDataSource,UITableViewDelegate>

//@property (weak, nonatomic) IBOutlet UILabel *lblUserNamePro;
//@property (weak, nonatomic) IBOutlet UILabel *lblRolePro;
//@property (weak, nonatomic) IBOutlet UILabel *lblShopNamePro;
//@property (weak, nonatomic) IBOutlet UILabel *lblDeptNamePro;
//
//@property (weak, nonatomic) IBOutlet UILabel *lblUserName;
//@property (weak, nonatomic) IBOutlet UILabel *lblRole;
//@property (weak, nonatomic) IBOutlet UILabel *lblShopName;
//@property (weak, nonatomic) IBOutlet UILabel *lblDeptName;
//@property (weak, nonatomic) IBOutlet UIImageView *viewUserInfo;

//@property (weak, nonatomic) IBOutlet UIView *viewUserInfo;
@property (strong, nonatomic)  UILabel *lblUserNamePro;
@property (strong, nonatomic)  UILabel *lblRolePro;
@property (strong, nonatomic)  UILabel *lblShopNamePro;
@property (strong, nonatomic)  UILabel *lblDeptNamePro;

@property (strong, nonatomic)  UILabel *lblUserName;
@property (strong, nonatomic)  UILabel *lblRole;
@property (strong, nonatomic)  UILabel *lblShopName;
@property (strong, nonatomic)  UILabel *lblDeptName;
@property (weak, nonatomic)  UIImageView *viewUserInfo;
@property(strong,nonatomic)UITableView *tableVContent;
@property(strong,nonatomic) NSDictionary *dictUserDetail;

@end

@implementation UserInfoViewController

//-(void)viewDidLoad
//{
//    [super viewDidLoad];
//    self.title=@"个人信息";
//   // [self setViewLayoutConstraint];
//    //self.view.backgroundColor=[UIColor clearColor];
//    
//    [self queryUserDetails];
//}
//- (void)setViewLayoutConstraint
//{
//    [self.tableVContent autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
//    
//}
//
//- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
//{
//    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
//    if (self) {
//        // Custom initialization
//        self.title = @"个人信息";
//    }
//    return self;
//}
-(void)loadView
{
    self.view=[[UIView alloc] init];
    self.view.backgroundColor=[UIColor clearColor];
}


-(void)viewDidLoad
{
    [super viewDidLoad];
    self.title=@"个人信息";

    
    self.tableVContent.backgroundColor=[UIColor whiteColor];
    
    [self.tableVContent autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    
    
    [self queryUserDetails];
}




//- (void)viewDidLoad
//{
//    [super viewDidLoad];
//
//    // Do any additional setup after loading the view.
//    [self setViewLayoutConstraint];
//    if ([[DataMgr getInstance].roleId isEqualToString:@"daqufuzeren"]) {
//        //self.viewUserInfo.backgroundColor = RGBColor(0, 98, 161, 1);
//        UIView *viewLine = [[UIView alloc] init];
//        viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 45, 300, 1.1)];
//        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
//        
//        [self.viewUserInfo addSubview:viewLine];
//        
//        viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 75, 300, 1.1)];
//        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
//        
//        [self.viewUserInfo addSubview:viewLine];
//        
//        viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 105, 300, 1.1)];
//        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
//        
//        [self.viewUserInfo addSubview:viewLine];
//    }
//    else if ([[DataMgr getInstance].roleId isEqualToString:@"xiaoqufuzeren"]) {
//        //self.viewUserInfo.backgroundColor = RGBColor(29, 159, 186, 1);
//        UIView *viewLine = [[UIView alloc] init];
//        viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 45, 300, 1.1)];
//        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
//        
//        [self.viewUserInfo addSubview:viewLine];
//
//        viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 75, 300, 1.1)];
//        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
//        
//        [self.viewUserInfo addSubview:viewLine];
//
//        viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 105, 300, 1.1)];
//        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
//        
//        [self.viewUserInfo addSubview:viewLine];
//
//        
//    }
//    else
//    {
//        UIView *viewLine = [[UIView alloc] init];
//        
//        //self.viewUserInfo.backgroundColor = RGBColor(44, 172, 237, 1);
//        self.viewUserInfo.backgroundColor =[UIColor whiteColor];
//     
////        UIGraphicsBeginImageContext(_viewUserInfo.frame.size);
////        [_viewUserInfo.image drawInRect:CGRectMake(0, 0, _viewUserInfo.frame.size.width, _viewUserInfo.frame.size.height)];
////        CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
////        CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 1.0);  //线宽
////        CGContextSetAllowsAntialiasing(UIGraphicsGetCurrentContext(), YES);
////        CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0.6, 0.6, 0.6, 0.3);  //颜色
////        CGContextBeginPath(UIGraphicsGetCurrentContext());
////        CGContextMoveToPoint(UIGraphicsGetCurrentContext(), 10, 45);  //起点坐标
////        CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), 310, 45);   //终点坐标
////        CGContextStrokePath(UIGraphicsGetCurrentContext());
////        _viewUserInfo.image=UIGraphicsGetImageFromCurrentImageContext();
////        UIGraphicsEndImageContext();
//        viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 45, 300, 1.1)];
//        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
//        
//        [self.viewUserInfo addSubview:viewLine];
////        UIGraphicsBeginImageContext(_viewUserInfo.frame.size);
////        [_viewUserInfo.image drawInRect:CGRectMake(0, 0, _viewUserInfo.frame.size.width, _viewUserInfo.frame.size.height)];
////        CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
////        CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 1.0);
////        CGContextSetAllowsAntialiasing(UIGraphicsGetCurrentContext(), YES);
////        CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0.6,0.6,0.6,0.3);
////        CGContextBeginPath(UIGraphicsGetCurrentContext());
////        CGContextMoveToPoint(UIGraphicsGetCurrentContext(), 10, 75);
////        CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), 310, 75);
////        CGContextStrokePath(UIGraphicsGetCurrentContext());
////        _viewUserInfo.image=UIGraphicsGetImageFromCurrentImageContext();
////        UIGraphicsGetCurrentContext();
////        
//        viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 75, 300, 1.1)];
//        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
//        
//        [self.viewUserInfo addSubview:viewLine];
////        UIGraphicsBeginImageContext(_viewUserInfo.frame.size);
////        [_viewUserInfo.image drawInRect:CGRectMake(0, 0, _viewUserInfo.frame.size.width, _viewUserInfo.frame.size.height)];
////        CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
////        CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 1.0);
////        CGContextSetAllowsAntialiasing(UIGraphicsGetCurrentContext(), YES);
////        CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0.6,0.6,0.6,0.3);
////        CGContextBeginPath(UIGraphicsGetCurrentContext());
////        CGContextMoveToPoint(UIGraphicsGetCurrentContext(), 10, 105);
////        CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), 310, 105);
////        CGContextStrokePath(UIGraphicsGetCurrentContext());
////        _viewUserInfo.image=UIGraphicsGetImageFromCurrentImageContext();
////        UIGraphicsGetCurrentContext();
//        viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 105, 300, 1.1)];
//        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
//        
//        [self.viewUserInfo addSubview:viewLine];
////        
////        UIGraphicsBeginImageContext(_viewUserInfo.frame.size);
////        [_viewUserInfo.image drawInRect:CGRectMake(0, 0, _viewUserInfo.frame.size.width, _viewUserInfo.frame.size.height)];
////        CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
////        CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 1);
////        CGContextSetAllowsAntialiasing(UIGraphicsGetCurrentContext(), YES);
////        CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0.6,0.6,0.6,0.3);
////        CGContextBeginPath(UIGraphicsGetCurrentContext());
////        CGContextMoveToPoint(UIGraphicsGetCurrentContext(), 10, 135);
////        CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), 310, 135);
////        CGContextStrokePath(UIGraphicsGetCurrentContext());
////        _viewUserInfo.image=UIGraphicsGetImageFromCurrentImageContext();
////        UIGraphicsGetCurrentContext();
//        viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 135, 300, 1.1)];
//        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
//        
//        [self.viewUserInfo addSubview:viewLine];
//        
//    }
//    [self queryUserDetails];
//}

//- (void)setViewLayoutConstraint
//{
//    
//    if ([[DataMgr getInstance].roleId isEqualToString:@"daqufuzeren"]) {
//        [self.viewUserInfo autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0, 0, 0, 0) excludingEdge:ALEdgeBottom];
//        [self.viewUserInfo autoSetDimension:ALDimensionHeight toSize:118];
//        [self.lblUserNamePro autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
//        [self.lblUserNamePro autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:20];
//        [self.lblUserName autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:100];
//        [self.lblUserName autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.lblUserNamePro];
//        
//        [self.lblRolePro autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
//        [self.lblRolePro autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.lblUserNamePro withOffset:10];
//        [self.lblRole autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:100];
//        [self.lblRole autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.lblRolePro];
//        
//        self.lblShopNamePro.hidden = YES;
//        self.lblShopName.hidden = YES;
//        [self.lblDeptNamePro autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
//        [self.lblDeptNamePro autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.lblRolePro withOffset:10];
//        [self.lblDeptName autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:100];
//        [self.lblDeptName autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.lblShopNamePro];
//    }
//    else if ([[DataMgr getInstance].roleId isEqualToString:@"xiaoqufuzeren"]) {
//        [self.viewUserInfo autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0, 0, 0, 0) excludingEdge:ALEdgeBottom];
//        [self.viewUserInfo autoSetDimension:ALDimensionHeight toSize:118];
//        [self.lblUserNamePro autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
//        [self.lblUserNamePro autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:20];
//        [self.lblUserName autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:100];
//        [self.lblUserName autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.lblUserNamePro];
//        
//        [self.lblRolePro autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
//        [self.lblRolePro autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.lblUserNamePro withOffset:10];
//        [self.lblRole autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:100];
//        [self.lblRole autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.lblRolePro];
//        
//        self.lblShopNamePro.hidden = YES;
//        self.lblShopName.hidden = YES;
//        [self.lblDeptNamePro autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
//        [self.lblDeptNamePro autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.lblRolePro withOffset:10];
//        [self.lblDeptName autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:100];
//        [self.lblDeptName autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.lblShopNamePro];
//    }
//    else
//    {
//        
//       
//        
//        [self.viewUserInfo autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0, 0, 0, 0) excludingEdge:ALEdgeBottom];
//        [self.viewUserInfo autoSetDimension:ALDimensionHeight toSize:148];
//        
//        [self.viewUserInfo autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0, 0, 0, 0) excludingEdge:ALEdgeBottom];
//        [self.viewUserInfo autoSetDimension:ALDimensionHeight toSize:148];
//        [self.lblUserNamePro autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
//        [self.lblUserNamePro autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:20];
//        [self.lblUserName autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:100];
//        [self.lblUserName autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.lblUserNamePro];
//        
//        [self.lblRolePro autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
//        [self.lblRolePro autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.lblUserNamePro withOffset:10];
//        [self.lblRole autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:100];
//        [self.lblRole autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.lblRolePro];
//        
//        [self.lblShopNamePro autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
//        [self.lblShopNamePro autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.lblRolePro withOffset:10];
//        [self.lblShopName autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:100];
//        [self.lblShopName autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.lblShopNamePro];
//        
//        [self.lblDeptNamePro autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
//        [self.lblDeptNamePro autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.lblShopNamePro withOffset:10];
//        [self.lblDeptName autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:100];
//        [self.lblDeptName autoAlignAxis:ALAxisHorizontal toSameAxisOfView:self.lblDeptNamePro];
//        
//    }
//}

- (void)queryUserDetails
{
    [UIApplication showLoadingView:kTextShowInProgress];
    NSString *interface = @"queryUserDetailsEX";
    NSOperation *operation = [self.networkMgr operationWithURL:kBaseEXURL(interface)
                                                     interface:interface
                                                        params:nil
                                                      dataType:BRNetMgrDataTypeJSON
                                                        method:BRNetMgrMethodPost];
    
    [self.networkMgr startOperation:operation];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark =============  BRNetworkMgr Delegate  =============
- (void)httpOperationSuccess:(AFHTTPRequestOperation *)operation
                      result:(NSDictionary *)result
{

    if ([operation.userInfo[@"interface"] isEqualToString:@"queryUserDetailsEX"])
    {
        NSDictionary *dictUserDetail = result[@"userDetails"];

        self.lblUserName.text = dictUserDetail[@"userName"];
        self.lblRole.text = dictUserDetail[@"roleName"];
        self.lblShopName.text = dictUserDetail[@"shopName"];
        self.lblDeptName.text = dictUserDetail[@"deptName"];
        
    }
    
}

- (void)httpOperationFailed:(AFHTTPRequestOperation *)operation
                      error:(NSError *)error
{
    NSLog(@"%@",error);
    
    
}
#pragma mark =============  Properties Lazy Load  =============


-(void)configureCell:(UITableViewCell*)cell forIndexPath:(NSIndexPath*)indexPath
{
     cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.textLabel.font=[UIFont boldSystemFontOfSize:17];
    
     cell.textLabel.textColor=[UIColor colorWithRed:0.2314 green:0.7098 blue:0.9373 alpha:1];    cell.textLabel.frame=CGRectMake(0, 0, 100, 44);
    
    
     if ([[DataMgr getInstance].roleId isEqualToString:@"daqufuzeren"])
         
     {
         
         switch (indexPath.row) {
             case 0:
                 cell.textLabel.text=@"用 户  名：";
                 cell.textLabel.textAlignment=NSTextAlignmentLeft;
                 self.lblUserName=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
                 self.lblUserName.text=@"";
                 self.lblUserName.textColor=[UIColor darkGrayColor];
                 self.lblUserName.textAlignment=NSTextAlignmentLeft;
                 [cell.contentView addSubview:self.lblUserName];
                 break;
             case 1:
                 cell.textLabel.text=@"角色类型：";
                 cell.textLabel.textAlignment=NSTextAlignmentLeft;
                 self.lblRole=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
                 self.lblRole.text=@"";
                 self.lblRole.textColor=[UIColor darkGrayColor];
                 self.lblRole.textAlignment=NSTextAlignmentLeft;
                 [cell.contentView addSubview:self.lblRole];
                 break;
             case 2:
                 cell.textLabel.text=@"所属部门：";
                 cell.textLabel.textAlignment=NSTextAlignmentLeft;
                 self.lblDeptName=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
                 self.lblDeptName.text=@"";
                 self.lblDeptName.textColor=[UIColor darkGrayColor];
                 self.lblDeptName.textAlignment=NSTextAlignmentLeft;
                 [cell.contentView addSubview:self.lblDeptName];
                 break;
             default:
                 break;
         }
         
         UIView *viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 43, 300, 1.1)];
         viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
         
         [cell.contentView addSubview:viewLine];
     }
    else  if ([[DataMgr getInstance].roleId isEqualToString:@"xiaoqufuzeren"])
    {
        
        switch (indexPath.row) {
            case 0:
                cell.textLabel.text=@"用 户  名：";
                cell.textLabel.textAlignment=NSTextAlignmentLeft;
                self.lblUserName=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
                self.lblUserName.text=@"";
                self.lblUserName.textColor=[UIColor darkGrayColor];
                self.lblUserName.textAlignment=NSTextAlignmentLeft;
                [cell.contentView addSubview:self.lblUserName];
                break;
            case 1:
                cell.textLabel.text=@"角色类型：";
                cell.textLabel.textAlignment=NSTextAlignmentLeft;
                self.lblRole=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
                self.lblRole.text=@"";
                self.lblRole.textColor=[UIColor darkGrayColor];
                self.lblRole.textAlignment=NSTextAlignmentLeft;
                [cell.contentView addSubview:self.lblRole];
                break;
            case 2:
                cell.textLabel.text=@"所属部门：";
                cell.textLabel.textAlignment=NSTextAlignmentLeft;
                self.lblDeptName=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
                self.lblDeptName.text=@"";
                self.lblDeptName.textColor=[UIColor darkGrayColor];
                self.lblDeptName.textAlignment=NSTextAlignmentLeft;
                [cell.contentView addSubview:self.lblDeptName];
                break;
            default:
                break;
        }
        
        UIView *viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 43, 300, 1.1)];
        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
        
        [cell.contentView addSubview:viewLine];
    }
    else
    {
    
    switch (indexPath.row) {
        case 0:
            cell.textLabel.text=@"用 户  名：";
            cell.textLabel.textAlignment=NSTextAlignmentLeft;
            self.lblUserName=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
            self.lblUserName.text=@"";
            self.lblUserName.textColor=[UIColor darkGrayColor];
            self.lblUserName.textAlignment=NSTextAlignmentLeft;
            [cell.contentView addSubview:self.lblUserName];
            break;
        case 1:
            cell.textLabel.text=@"角色类型：";
            cell.textLabel.textAlignment=NSTextAlignmentLeft;
            self.lblRole=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
            self.lblRole.text=@"";
            self.lblRole.textColor=[UIColor darkGrayColor];
            self.lblRole.textAlignment=NSTextAlignmentLeft;
            [cell.contentView addSubview:self.lblRole];
            break;
        case 2:
            cell.textLabel.text=@"所属门店：";
            cell.textLabel.textAlignment=NSTextAlignmentLeft;
            self.lblShopName=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
            self.lblShopName.text=@"";
            self.lblShopName.textColor=[UIColor darkGrayColor];
            self.lblShopName.textAlignment=NSTextAlignmentLeft;
            [cell.contentView addSubview:self.lblShopName];
            break;
        case 3:
            cell.textLabel.text=@"所属部门：";
            cell.textLabel.textAlignment=NSTextAlignmentLeft;
            self.lblDeptName=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 200, 44)];
            self.lblDeptName.text=@"";
            self.lblDeptName.textColor=[UIColor darkGrayColor];
            self.lblDeptName.textAlignment=NSTextAlignmentLeft;
             [cell.contentView addSubview:self.lblDeptName];
            break;
        default:
            break;
    }
  
        UIView *viewLine = [[UIView alloc] initWithFrame:CGRectMake(10, 43, 300, 1.1)];
        viewLine.backgroundColor=RGBColor(153, 153, 153,0.5 );
        
        [cell.contentView addSubview:viewLine];
        
    }
    
    
}



- (UITableView *)tableVContent
{
    if (_tableVContent) {
        return _tableVContent;
    }
    self.tableVContent = [UITableView newAutoLayoutView];
    
    _tableVContent.delegate = self;
    
    _tableVContent.dataSource = self;
    _tableVContent.separatorStyle = UITableViewCellSeparatorStyleNone;
   // _tableVContent.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    [self.view addSubview:_tableVContent];
    return _tableVContent;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0;
    
}

-(CGFloat)tableView:(UITableView *)tableView estimatedHeightForFooterInSection:(NSInteger)section
{
    return 44;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if ([[DataMgr getInstance].roleId isEqualToString:@"xiaoqufuzeren"] ||[[DataMgr getInstance].roleId isEqualToString:@"daqufuzeren"] )
        return 3;
    else
        return 4;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    
    [self configureCell:cell forIndexPath:indexPath];
    
    return cell;
}









@end
