本文整理汇总了C#中Api.getCategories方法的典型用法代码示例。如果您正苦于以下问题:C# Api.getCategories方法的具体用法?C# Api.getCategories怎么用?C# Api.getCategories使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Api
的用法示例。
在下文中一共展示了Api.getCategories方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SalesReportPage
public SalesReportPage()
{
InitializeComponent ();
ListView checkView = new ListView();
User user = App.user;
ListView categoryView = new ListView();
Label mainLabel = new Label ();
mainLabel.Text = "Отчет продаж";
mainLabel.HorizontalOptions = LayoutOptions.Center;
mainLabel.TextColor = Color.FromHex ("FFFFFF");
var menuCheck = new Image ();
menuCheck.Source = "menuCheck.png";
var menuUser = new Image ();
menuUser.Source = "menuUser.png";
var sellsLabel = new Label{ TextColor = Color.FromHex("838282"), FontSize = 10, Text = "общая касса", HorizontalOptions = LayoutOptions.EndAndExpand };
var checkLabel = new Label{ TextColor = Color.FromHex("838282"), FontSize = 10, Text = "средний чек", HorizontalOptions = LayoutOptions.EndAndExpand };
var guestLabel = new Label{ TextColor = Color.FromHex("838282"), FontSize = 10, Text = "посетители", HorizontalOptions = LayoutOptions.EndAndExpand };
var timeLabel = new Label{ TextColor = Color.FromHex("838282"), FontSize = 10, Text = "время смены", HorizontalOptions = LayoutOptions.EndAndExpand };
var sellsCountLabel = new Label{ TextColor = Color.White, Text = "0.00", HorizontalOptions = LayoutOptions.Start };
var checkCountLabel = new Label{ TextColor = Color.White, Text = "0", HorizontalOptions = LayoutOptions.Start };
var guestCountLabel = new Label{ TextColor = Color.White, Text = "0", HorizontalOptions = LayoutOptions.Start };
var timeCountLabel = new Label{ TextColor = Color.White, Text = "00:00" , HorizontalOptions = LayoutOptions.Start};
Label middleCheck = new Label ();
middleCheck.Text = "Средний чек: 0 грн";
middleCheck.TextColor = Color.FromHex ("FFFFFF");
Label totalGuests = new Label ();
totalGuests.TextColor = Color.FromHex ("FFFFFF");
totalGuests.Text = "Количество гостей: 0 Человек";
Api api = new Api ();
Series lineSeries = new Series
{
Color = Color.FromHex("FFC944"),
Type = ChartType.Line
};
lineSeries.Points.Add(new DataPoint() { Label = "Jan1", Value = 0 });
lineSeries.Points.Add(new DataPoint() { Label = "Jan2", Value = 5 });
lineSeries.Points.Add(new DataPoint() { Label = "Jan3", Value = 1 });
lineSeries.Points.Add(new DataPoint() { Label = "Jan4", Value = 0 });
lineSeries.Points.Add(new DataPoint() { Label = "March", Value = 0 });
Chart reportChart = new Chart {
//Color = Color.White,
WidthRequest = 321,
HeightRequest = 247,
Spacing = 10,
Grid = true,
BackgroundColor = Color.FromHex("666666"),
Color = Color.FromHex("777"),
};
reportChart.Series.Add (lineSeries);
DatePicker dateStartPicker = new DatePicker
{
Format = "d MMMM yyyy",
VerticalOptions = LayoutOptions.CenterAndExpand,
BackgroundColor = Color.FromHex("666666"),
};
DatePicker dateEndPicker = new DatePicker
{
Format = "d MMMM yyyy",
BackgroundColor = Color.FromHex("666666"),
VerticalOptions = LayoutOptions.CenterAndExpand
};
categoryView.BeginRefresh ();
categoryView.ItemTemplate = new DataTemplate (typeof(CategoryReportCell));
if (user != null) {
var categories = api.getCategories (user);
categoryView.ItemsSource = categories;
}
categoryView.EndRefresh ();
checkView.ItemsSource = new string[]{
"Чеков без оплаты 0 >",
"Чеков со скидкой 0 >"
};
var line = new BoxView{
Color = Color.FromHex("838282"),
WidthRequest = 100,
HeightRequest = 1
};
this.Padding = new Thickness (0, Device.OnPlatform (0, 0, 0), 0, 5);
var headerLayout = new StackLayout{
Children = {
mainLabel,
reportChart,
new StackLayout{
Padding = new Thickness(10,0,10,0),
Spacing = 5,
Orientation = StackOrientation.Horizontal,
Children = {
menuCheck,
checkCountLabel,
checkLabel
//.........这里部分代码省略.........
示例2: CategoryListEditPage
public CategoryListEditPage()
{
NavigationPage.SetHasNavigationBar (this, false);
App.MasterDetailPage.IsPresented = false;
InitializeComponent ();
var user = App.user;
var categoryView = new ListView();
var api = new Api ();
categoryView.SeparatorColor = Color.FromHex ("E6E2DB");
categoryView.BeginRefresh ();
categoryView.ItemTemplate = new DataTemplate (typeof(CategoryEditCell));
if (user != null) {
var categories = api.getCategories (user);
categoryView.ItemsSource = categories;
}
categoryView.ItemTapped += (sender, e) => {
categoryView.SelectedItem = null;
App.MasterDetailPage.Detail = new CategoryEditPage(e.Item as Category);
};
categoryView.EndRefresh ();
//this.Padding = new Thickness (10, 30, 10, 5);
// Set the content for the page.
this.Content = new StackLayout {
BackgroundColor = Color.FromHex("E6E2DB"),
Children = {
new StackLayout{
Padding = new Thickness (10, 40, 10, 15),
BackgroundColor = Color.FromHex("525151"),
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Orientation = StackOrientation.Horizontal,
Children = {
new Label {
HorizontalOptions = LayoutOptions.CenterAndExpand,
Text = "Управление товаром",
TextColor = Color.White
}
}
},
new StackLayout{
Padding = new Thickness (0, 40, 0, 0),
BackgroundColor = Color.FromHex("E6E2DB"),
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Children = {
new Label {
HorizontalOptions = LayoutOptions.StartAndExpand,
VerticalOptions = LayoutOptions.End,
Text = "Категории",
TextColor = Color.FromHex("666")
},
categoryView
}
}
},
};
}