public OrderQA(String Style_Id, List <尺寸呈现dto> lst, String ORDER_ID, String REMARKS, Frm已付款订单一览 Frm已付款订单一览) { InitializeComponent(); this.Style_Id = Style_Id; this.model.尺寸呈现 = lst; this.ORDER_ID = ORDER_ID; this.REMARKS = REMARKS; this.Frm已付款订单一览 = Frm已付款订单一览; this.款式图片一览Dtos.Add(StyleService.getStyleByORDER_ID(ORDER_ID)); // 尺寸 this.model.build款式全尺寸(Style_Id).build设计点(Style_Id); // 控件行为 //this.gridControl款式.DataSource = this.款式图片一览Dtos; //this.gridControl面料.DataSource = this.model.面料信息; //this.gridControlSize.DataSource = this.model.尺寸呈现; //this.gridControl设计点.DataSource = this.model.Dto定制下单.Dto设计点s; // 模板 TODO ((DevExpress.XtraEditors.Repository.RepositoryItemComboBox) this.barEditItemTemplate.Edit).Items.Add("样品下单"); ((DevExpress.XtraEditors.Repository.RepositoryItemComboBox) this.barEditItemTemplate.Edit).Items.Add("定制下单"); this.barEditItemTemplate.EditValue = ((DevExpress.XtraEditors.Repository.RepositoryItemComboBox) this.barEditItemTemplate.Edit).Items[0]; }
public async Task ReturnAllStyles_If_Exist() { var options = TestUtils.GetOptions(nameof(ReturnAllStyles_If_Exist)); var mockDateTime = new Mock <IDateTimeProvider>(); var style = new Style { Id = 1, Name = "Pale" }; var style2 = new Style { Id = 2, Name = "Dark Lagers" }; using (var arrangeContext = new BeeroverflowContext(options)) { await arrangeContext.Styles.AddAsync(style); await arrangeContext.Styles.AddAsync(style2); await arrangeContext.SaveChangesAsync(); } using (var assertContext = new BeeroverflowContext(options)) { var sut = new StyleService(assertContext, mockDateTime.Object); var resultDTOs = await sut.GetAllStylesAsync(); var result = resultDTOs.Select(x => x.Name).ToList(); Assert.AreEqual(2, result.Count()); Assert.IsTrue(result.Contains("Pale")); Assert.IsTrue(result.Contains("Dark Lagers")); } }
public RetailBrandController(StyleService styleService, SkuService skuService) { _styleService = styleService; _skuService = skuService; }
/// <summary> /// Called when the category setting is toggled. Adds or removes a series from the chart /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CategoryToggle_Toggled(object sender, RoutedEventArgs e) { // Get the name of the catefory from the toggle switch string CategoryName = ((sender as ToggleSwitch).OnContent as string); // Check to see if it was toggled on or off if ((sender as ToggleSwitch).IsOn) { List <Expense> TempItems; List <DateValueItem> TempChartData = new List <DateValueItem>(); LineSeries CategorySeries = new LineSeries(); Binding CategorySeriesIVBinding = new Binding(); Binding CategorySeriesDVBinding = new Binding(); Style CategoryYAxisStyle = new Style(typeof(NumericAxisLabel)); Style CategoryXAxisStyle = new Style(typeof(DateTimeAxisLabel)); Setter Hide = new Setter(VisibilityProperty, Visibility.Collapsed); // Set the axis stule for the series CategoryYAxisStyle.Setters.Add(Hide); CategoryXAxisStyle.Setters.Add(Hide); // Set the path bindings for the X and Y axis data. CategorySeriesIVBinding.Path = new PropertyPath("Date"); CategorySeriesDVBinding.Path = new PropertyPath("Value"); // Find all the expenses for the category if (CategoryName == "Total Expenses") { TempItems = Expenses; } else { TempItems = Expenses.FindAll(a => a.Category == CategoryName); } // Add all the expenses to a list for displaying foreach (Expense i in TempItems) { TempChartData.Add(new DateValueItem { Date = (i.Date + i.Time.TimeOfDay), Value = (int)i.Price, Id = i.Id }); } // Setup the series CategorySeries.Name = CategoryName + "Series"; CategorySeries.Title = CategoryName; CategorySeries.ItemsSource = TempChartData; CategorySeries.IndependentValueBinding = CategorySeriesIVBinding; CategorySeries.DependentValueBinding = CategorySeriesDVBinding; CategorySeries.IsSelectionEnabled = true; CategorySeries.SelectionChanged += DataPointTapped; CategorySeries.IndependentAxis = ((ExpenseChart.Series[0] as LineSeries).IndependentAxis as DateTimeAxis); CategorySeries.DependentRangeAxis = ((ExpenseChart.Series[0] as LineSeries).DependentRangeAxis as LinearAxis); CategorySeries.DataPointStyle = StyleService.LargeDataPoint(StyleService.Colours[ExpenseChart.Series.Count]); // Get the rectangle for the category to colour to match the series colour foreach (StackPanel i in ChartSettings.Items) { if ((i.Children[0] as ToggleSwitch) == (sender as ToggleSwitch)) { (i.Children[1] as Rectangle).Fill = new SolidColorBrush(StyleService.Colours[ExpenseChart.Series.Count]); } } // Add the series to the chart ExpenseChart.Series.Add(CategorySeries); CategorySeries.Refresh(); } // If the switch is turned off, remove the series else { // Find the series for the toggle by category name and remove it foreach (LineSeries i in ExpenseChart.Series) { if ((string)i.Title == CategoryName) { ExpenseChart.Series.Remove(i); break; } } // Find the ractangle for the category and colour it gray foreach (StackPanel i in ChartSettings.Items) { if ((i.Children[0] as ToggleSwitch) == (sender as ToggleSwitch)) { (i.Children[1] as Rectangle).Fill = new SolidColorBrush(Colors.Gray); break; } } // Recolour all the remaining line series to be the colour for they're position in the series list foreach (LineSeries i in ExpenseChart.Series) { i.DataPointStyle = StyleService.LargeDataPoint(StyleService.Colours[ExpenseChart.Series.IndexOf(i)]); foreach (StackPanel j in ChartSettings.Items) { if (ChartSettings.Items.IndexOf(j) > 0) { if (((j.Children[0] as ToggleSwitch).OnContent as string) == (i.Title as string)) { (j.Children[1] as Rectangle).Fill = new SolidColorBrush(StyleService.Colours[ExpenseChart.Series.IndexOf(i)]); } } } } } }
internal StyleServiceSetterCollection(StyleService styleService) : base(null) { Service = styleService; }
public StyleController() { styleService = new StyleService(); }
public StylesController(ApplicationDbContext context, StyleService styleService) { _context = context; _styleService = styleService; }