Skip to content

Instantly share code, notes, and snippets.

@alexsosn
Created May 7, 2014 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexsosn/6c0ce0dfe7dd5ab30f81 to your computer and use it in GitHub Desktop.
Save alexsosn/6c0ce0dfe7dd5ab30f81 to your computer and use it in GitHub Desktop.
- (void)drawRect:(CGRect)rect
{
SQLClient* client = [SQLClient sharedInstance];
client.delegate = self;
[client connect:@"10.146.1.28:1433" username:@"sa" password:@"password" database:@"Intraservice4" completion:^(BOOL success) {
if (success)
{
[client execute:@"SELECT u.Name,count(t.Id) as tot FROM [Intraservice4].[dbo].[Task] t left join TaskExecutor te on t.id = te.TaskId left join [User] u on te.UserId = u.id where 1=1 and StatusId not in ( 28,29,30,53) group by u.Name order by u.Name" completion:^(NSArray* results) {
//NSLog(@"%@",[results[0][0] valueForKey:@"tot"]);
NSLog(@"ДАННЫЕ ИЗ БД ПОЛУЧЕНЫ");
//[self process:results];
[client disconnect];
}];
}
}];
NSLog(@"ОТРИСОВАЛИ");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment