class Company
{
public List<Office> Offices {get; set;}
public string Description {get; set;} //Тут описание вашей компании: год основания там и все такое.
public Contacts GlobalContacts {get;set;} //Глобальные контакты для всей компании
}
class Office
{
public Address Address {get; set;}
public List<Employee> Employees {get; set;}
public List<Tour> Tours {get;set;}
public Contacts Contacts {get;set;}
}
class Address
{
public string Country {get;set;}
public string City {get;set;}
public string Street {get;set;}
public string HouseNumber {get; set;}
}
class Tour
{
public string Country {get; set;}
public string City {get; set;}
public Hotel Hotel {get; set;}
}
class Hotel
{
public string Description {get;set;}
public Address Address {get; set;}
public List<Image> Images{get; set;}
}
var office = new Office(
new Address(country, city, street, houseNumber),
new List<Employee>(),
new List<Tour>(),
new Contacts { Email = "office@mail"}
);
<div ng-app>
<table ng-controller="buyCtrl">
<tr ng-repeat="product in products" ng-mouseover="productHovered($index)">
<td >{{product.name}}</td>
<td class="buy">{{product.count}}/10</td>
<td><a ng-class="product.buttonCss">Купить</a></td>
</tr>
</table>
</div>
.red{
color:red;
}
.green{
color:green;
}
function buyCtrl($scope) {
$scope.products = [
{name:'Помидоры', count:1, buttonCss:"green"},
{name:'Огурцы', count:0, buttonCss:"green"},
{name:'Картофель', count:0, buttonCss:"green"}
];
$scope.productHovered = function(selectedProductIndex){
$scope.products.forEach(function(product){
product.buttonCss = "green";
});
$scope.products[selectedProductIndex].buttonCss = "red";
}
}
webBrowserAuth.Navigated += (sender, e) =>
{
if(e.Url.GetLeftPart(UriPartial.Query) == "https://oauth.vk.com/blank.html")
{
var url = new Uri(e.Url.AbsoluteUri.Replace('#', '?'));
var parameters = HttpUtility.ParseQueryString(url.Query);
var accessToken = parameters.Get("access_token");
var expiresIn = parameters.Get("expires_in");
var userId = parameters.Get("user_id");
}
};
public Vk Authorize()
{
var form = new Form { Width = 800, Height = 600 };
var vk = new Vk();
var thread = new Thread(() =>
{
var browser = new WebBrowser { Parent = form, Dock = DockStyle.Fill };
var authLink =
$"https://oauth.vk.com/authorize?client_id={_appId}&display=popup&redirect_uri=https://oauth.vk.com/blank.html&scope={_scopes}&response_type=token&v=5.37";
browser.Navigate(authLink);
browser.Navigated += (sender, e) =>
{
if (e.Url.GetLeftPart(UriPartial.Query) == "https://oauth.vk.com/blank.html")
{
var url = new Uri(e.Url.AbsoluteUri.Replace('#', '?'));
var parameters = HttpUtility.ParseQueryString(url.Query);
var accessToken = parameters.Get("access_token");
var expiresIn = parameters.Get("expires_in");
var userId = parameters.Get("user_id");
vk = new Vk(accessToken, expiresIn, userId);
form.Close();
}
};
form.ShowDialog();
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
return vk;
}