|
|
@@ -7,6 +7,7 @@
|
|
|
//
|
|
|
|
|
|
#import "CategorySearchFilterViewController.h"
|
|
|
+#import "AppDelegate.h"
|
|
|
|
|
|
@interface CategorySearchFilterViewController ()
|
|
|
|
|
|
@@ -17,6 +18,22 @@
|
|
|
- (void)viewDidLoad {
|
|
|
[super viewDidLoad];
|
|
|
|
|
|
+
|
|
|
+ UIApplication * app = [UIApplication sharedApplication];
|
|
|
+ AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
+ if(appDelegate.bLogin)
|
|
|
+ {
|
|
|
+ self.labelPrice.hidden=false;
|
|
|
+ self.buttonPrice.hidden=false;
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ self.labelPrice.hidden=true;
|
|
|
+ self.buttonPrice.hidden=true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
|
|
|
style:UIBarButtonItemStylePlain
|
|
|
target:self
|
|
|
@@ -32,7 +49,7 @@
|
|
|
{
|
|
|
|
|
|
NSString* qty =@"";
|
|
|
- int count = [[self.alert_cadedate valueForKey:@"count"] intValue];
|
|
|
+ int count = [[self.qty_cadedate valueForKey:@"count"] intValue];
|
|
|
for(int i=0;i<count;i++)
|
|
|
{
|
|
|
NSDictionary* val_json =[self.qty_cadedate objectForKey:[NSString stringWithFormat:@"val_%d",i]];
|
|
|
@@ -48,6 +65,26 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ {
|
|
|
+
|
|
|
+ NSString* price =@"";
|
|
|
+ int count = [[self.price_cadedate valueForKey:@"count"] intValue];
|
|
|
+ for(int i=0;i<count;i++)
|
|
|
+ {
|
|
|
+ NSDictionary* val_json =[self.price_cadedate objectForKey:[NSString stringWithFormat:@"val_%d",i]];
|
|
|
+ int check = [[val_json valueForKey:@"check"] intValue];
|
|
|
+ if(check==1)
|
|
|
+ {
|
|
|
+ price = [price stringByAppendingString:[val_json valueForKey:@"value"]];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(price.length>0)
|
|
|
+ [self.buttonPrice setTitle:price forState:UIControlStateNormal];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
{
|
|
|
|
|
|
NSString* availiablity =@"";
|
|
|
@@ -183,6 +220,43 @@
|
|
|
|
|
|
[self.navigationController pushViewController:enumvc animated:true];
|
|
|
}
|
|
|
+- (IBAction)onPriceClick:(id)sender {
|
|
|
+ EnumSelectViewController* enumvc =[ self.storyboard instantiateViewControllerWithIdentifier:@"EnumSelectorViewController"];
|
|
|
+ // enumvc.delegate = self;
|
|
|
+ enumvc.max_select = 1;
|
|
|
+ //enumvc.updatePosition = indexPath;
|
|
|
+ // if([[required lowercaseString] isEqualToString:@"true"])
|
|
|
+ // enumvc.canbeEmpty = false;
|
|
|
+ // else
|
|
|
+ // enumvc.canbeEmpty =true;
|
|
|
+ enumvc.cadedate = [self.price_cadedate mutableCopy];
|
|
|
+ enumvc.title = @"Select";
|
|
|
+ // enumvc.value = [value_json mutableCopy];
|
|
|
+ enumvc.single_select =true;
|
|
|
+
|
|
|
+
|
|
|
+ enumvc.returnValue = ^(NSMutableDictionary* value){
|
|
|
+ self.price_cadedate = value;
|
|
|
+
|
|
|
+
|
|
|
+ NSString* price =@"";
|
|
|
+ int count = [[value valueForKey:@"count"] intValue];
|
|
|
+ for(int i=0;i<count;i++)
|
|
|
+ {
|
|
|
+ NSDictionary* val_json =[value objectForKey:[NSString stringWithFormat:@"val_%d",i]];
|
|
|
+ int check = [[val_json valueForKey:@"check"] intValue];
|
|
|
+ if(check==1)
|
|
|
+ {
|
|
|
+ price = [price stringByAppendingString:[val_json valueForKey:@"value"]];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ [self.buttonPrice setTitle:price forState:UIControlStateNormal];
|
|
|
+ };
|
|
|
+
|
|
|
+ [self.navigationController pushViewController:enumvc animated:true];
|
|
|
+}
|
|
|
- (IBAction)onAlertClick:(id)sender {
|
|
|
|
|
|
|
|
|
@@ -234,6 +308,10 @@
|
|
|
if(qty.length==0 || [qty isEqualToString:@"Click to select"])
|
|
|
qty = nil;
|
|
|
|
|
|
+ NSString* price = [self.buttonPrice titleForState:UIControlStateNormal];
|
|
|
+ if(price.length==0 || [price isEqualToString:@"Click to select"])
|
|
|
+ price = nil;
|
|
|
+
|
|
|
NSString* available = [self.buttonAvailability titleForState:UIControlStateNormal];
|
|
|
if(available.length==0 || [available isEqualToString:@"Click to select"])
|
|
|
available = nil;
|
|
|
@@ -244,7 +322,7 @@
|
|
|
|
|
|
|
|
|
if(self.OkClick)
|
|
|
- self.OkClick( available, qty, alert);
|
|
|
+ self.OkClick( available, qty, alert,price);
|
|
|
[self dismissViewControllerAnimated:true completion:nil];
|
|
|
}
|
|
|
|