|
|
@@ -99,7 +99,7 @@
|
|
|
// userVC.returnValue=^(NSString* user)
|
|
|
// {
|
|
|
//// self.btnContact.hidden = false;
|
|
|
-// appDelegate.user = user;
|
|
|
+// RASingleton.sharedInstance.user = user;
|
|
|
// [self.buttonUser setTitle:user forState:UIControlStateNormal];
|
|
|
//
|
|
|
// [self refreshContactDisplay];
|
|
|
@@ -329,9 +329,9 @@
|
|
|
[self initMenuItems];
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
|
- self.sideMenu_UserName.text =appDelegate.user;
|
|
|
+ self.sideMenu_UserName.text =RASingleton.sharedInstance.user;
|
|
|
|
|
|
- [self.btn_sideMenu_UserName setTitle:appDelegate.user forState:UIControlStateNormal];
|
|
|
+ [self.btn_sideMenu_UserName setTitle:RASingleton.sharedInstance.user forState:UIControlStateNormal];
|
|
|
|
|
|
if(appDelegate.bLogin)
|
|
|
[self.btnLogin setTitle:@"Sign out" forState:UIControlStateNormal];
|
|
|
@@ -386,7 +386,7 @@
|
|
|
[self.btnContact setTitle:contact_string forState:UIControlStateNormal];
|
|
|
|
|
|
// if(appDelegate.bLogin)
|
|
|
- // [self.buttonUser setTitle:appDelegate.user forState:UIControlStateNormal];
|
|
|
+ // [self.buttonUser setTitle:RASingleton.sharedInstance.user forState:UIControlStateNormal];
|
|
|
// else
|
|
|
// [self.buttonUser setTitle:@"Sign in" forState:UIControlStateNormal];
|
|
|
|
|
|
@@ -1267,7 +1267,7 @@
|
|
|
}
|
|
|
|
|
|
NSMutableDictionary* orderitem = [NSMutableDictionary new];
|
|
|
- orderitem[@"create_by"] = appDelegate.user;
|
|
|
+ orderitem[@"create_by"] = RASingleton.sharedInstance.user;
|
|
|
|
|
|
orderitem[@"price"] = [RAConvertor currencyNumber:p+s];//[NSString stringWithFormat:@"%.2f",p+s];
|
|
|
orderitem[@"model_count"] =[ NSString stringWithFormat:@"%d",order_qty];
|
|
|
@@ -1317,10 +1317,10 @@
|
|
|
|
|
|
DebugLog(@"header view login");
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
- if( appDelegate.user ==nil /*|| [appDelegate.user isEqualToString:@"GUEST"]*/)
|
|
|
+ if( RASingleton.sharedInstance.user ==nil /*|| [RASingleton.sharedInstance.user isEqualToString:@"GUEST"]*/)
|
|
|
{
|
|
|
|
|
|
-// appDelegate.user = nil;
|
|
|
+// RASingleton.sharedInstance.user = nil;
|
|
|
// appDelegate.password = nil;
|
|
|
LoginViewController * loginvc =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginViewController"];
|
|
|
// loginvc.delegate = self;
|
|
|
@@ -1519,8 +1519,8 @@
|
|
|
[viewController dismissViewControllerAnimated:YES completion:^{
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
|
- self.sideMenu_UserName.text =appDelegate.user;
|
|
|
- [self.btn_sideMenu_UserName setTitle:appDelegate.user forState:UIControlStateNormal];
|
|
|
+ self.sideMenu_UserName.text =RASingleton.sharedInstance.user;
|
|
|
+ [self.btn_sideMenu_UserName setTitle:RASingleton.sharedInstance.user forState:UIControlStateNormal];
|
|
|
|
|
|
[self.btnLogin setTitle:@"Sign out" forState:UIControlStateNormal];
|
|
|
|
|
|
@@ -1566,7 +1566,7 @@
|
|
|
|
|
|
[self.btnContact setTitle:contact_string forState:UIControlStateNormal];
|
|
|
|
|
|
- // [self.buttonUser setTitle:appDelegate.user forState:UIControlStateNormal];
|
|
|
+ // [self.buttonUser setTitle:RASingleton.sharedInstance.user forState:UIControlStateNormal];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1957,7 +1957,7 @@
|
|
|
NSMutableDictionary* map = [[NSMutableDictionary alloc] init];
|
|
|
|
|
|
|
|
|
- if(appDelegate.user!=nil)
|
|
|
+ if(RASingleton.sharedInstance.user!=nil)
|
|
|
{
|
|
|
[map setValue:@"Wish List" forKey:@"title"];
|
|
|
[map setValue:@"rect_market_news" forKey:@"img"];
|
|
|
@@ -2054,12 +2054,12 @@
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
- if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore ) {
|
|
|
+ if (RASingleton.sharedInstance.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore ) {
|
|
|
[map setValue:@"Price Setting" forKey:@"title"];
|
|
|
// [map setValue:@"rect_market_news" forKey:@"img"];
|
|
|
[self.sideMenuItems addObject:map.copy];
|
|
|
}
|
|
|
- if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore ) {
|
|
|
+ if (RASingleton.sharedInstance.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore ) {
|
|
|
if ([RASingleton sharedInstance].global_lock) {
|
|
|
[map setValue:@"Unlock" forKey:@"title"];
|
|
|
} else {
|
|
|
@@ -2081,12 +2081,12 @@
|
|
|
|
|
|
}
|
|
|
*/
|
|
|
-// if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
|
|
|
+// if (RASingleton.sharedInstance.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
|
|
|
// [map setValue:@"Price Setting" forKey:@"title"];
|
|
|
// // [map setValue:@"rect_market_news" forKey:@"img"];
|
|
|
// [self.sideMenuItems addObject:map.copy];
|
|
|
// }
|
|
|
- if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore ) {
|
|
|
+ if (RASingleton.sharedInstance.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore ) {
|
|
|
if ([Singleton sharedInstance].global_lock) {
|
|
|
[map setValue:@"Unlock" forKey:@"title"];
|
|
|
} else {
|
|
|
@@ -2099,7 +2099,7 @@
|
|
|
# endif
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
-// if([[appDelegate.user lowercaseString] isEqualToString:@"larryl"]||[[appDelegate.user lowercaseString] isEqualToString:@"arpithat"])
|
|
|
+// if([[RASingleton.sharedInstance.user lowercaseString] isEqualToString:@"larryl"]||[[RASingleton.sharedInstance.user lowercaseString] isEqualToString:@"arpithat"])
|
|
|
{
|
|
|
// [map setValue:@"Contact" forKey:@"title"];
|
|
|
// [map setValue:@"rect_contact_list" forKey:@"img"];
|
|
|
@@ -2845,7 +2845,7 @@
|
|
|
if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore && [RASingleton sharedInstance].global_lock) {
|
|
|
|
|
|
JKLockController *lockVC = [[JKLockController alloc] init];
|
|
|
- [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
|
|
|
+ [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",RASingleton.sharedInstance.user]];
|
|
|
__weak typeof(self) weakself = self;
|
|
|
lockVC.authoReturn = ^(BOOL failure) {
|
|
|
|
|
|
@@ -2879,7 +2879,7 @@
|
|
|
if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore && [RASingleton sharedInstance].global_lock) {
|
|
|
|
|
|
JKLockController *lockVC = [[JKLockController alloc] init];
|
|
|
- [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
|
|
|
+ [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",RASingleton.sharedInstance.user]];
|
|
|
__weak typeof(self) weakself = self;
|
|
|
lockVC.authoReturn = ^(BOOL failure) {
|
|
|
|
|
|
@@ -2968,7 +2968,7 @@
|
|
|
if ([RASingleton sharedInstance].global_lock) {
|
|
|
|
|
|
JKLockController *lockVC = [[JKLockController alloc] init];
|
|
|
- [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
|
|
|
+ [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",RASingleton.sharedInstance.user]];
|
|
|
__weak typeof(self) weakself = self;
|
|
|
lockVC.authoReturn = ^(BOOL failure) {
|
|
|
|
|
|
@@ -3009,7 +3009,7 @@
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
|
|
|
JKLockController *lockVC = [[JKLockController alloc] init];
|
|
|
- [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
|
|
|
+ [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",RASingleton.sharedInstance.user]];
|
|
|
__weak typeof(self) weakself = self;
|
|
|
lockVC.authoReturn = ^(BOOL failure) {
|
|
|
|