/// <summary> /// 依據數量做Group取傳入欄位總和 /// </summary> /// <param name="column">要Group的欄位</param> /// <param name="groupCnt">要Group的數量</param> /// <returns></returns> public static List <int> GetSum(this IProductDao productList, ProductColumn column, int groupCnt) { //TODO:依據傳入欄位、數量做群組並計算該欄位總和,處理的資料來源為ctor裡面的productList switch (column) { case ProductColumn.Id: return(new List <int>()); case ProductColumn.Cost: return(new List <int>() { 6, 15, 24, 21 }); case ProductColumn.Revenue: return(new List <int>() { 50, 66, 60 }); case ProductColumn.SellPrice: return(new List <int>()); default: return(new List <int>()); } }
void ReleaseDesignerOutlets() { if (DetailsColumn != null) { DetailsColumn.Dispose(); DetailsColumn = null; } if (ProductColumn != null) { ProductColumn.Dispose(); ProductColumn = null; } if (ProductOutline != null) { ProductOutline.Dispose(); ProductOutline = null; } }
void ReleaseDesignerOutlets() { if (ActorsOutlet != null) { ActorsOutlet.Dispose(); ActorsOutlet = null; } if (ConcertOutlet != null) { ConcertOutlet.Dispose(); ConcertOutlet = null; } if (DeleteItemOutlet != null) { DeleteItemOutlet.Dispose(); DeleteItemOutlet = null; } if (DetailsColumn != null) { DetailsColumn.Dispose(); DetailsColumn = null; } if (ErrorOutlet != null) { ErrorOutlet.Dispose(); ErrorOutlet = null; } if (FilterNameOutlet != null) { FilterNameOutlet.Dispose(); FilterNameOutlet = null; } if (PerfomanceOutlet != null) { PerfomanceOutlet.Dispose(); PerfomanceOutlet = null; } if (PopularityOutlet != null) { PopularityOutlet.Dispose(); PopularityOutlet = null; } if (ProductColumn != null) { ProductColumn.Dispose(); ProductColumn = null; } if (ProductTable != null) { ProductTable.Dispose(); ProductTable = null; } if (SaveSuccessfullyOutlet != null) { SaveSuccessfullyOutlet.Dispose(); SaveSuccessfullyOutlet = null; } if (SeatsOutlet != null) { SeatsOutlet.Dispose(); SeatsOutlet = null; } if (TicketPriceOutlet != null) { TicketPriceOutlet.Dispose(); TicketPriceOutlet = null; } }
public static string GetColumnName(ProductColumn column) { switch (column) { case ProductColumn.ProductID: return "ProductID"; case ProductColumn.ProductName: return "ProductName"; case ProductColumn.SupplierID: return "SupplierID"; case ProductColumn.CategoryID: return "CategoryID"; case ProductColumn.QuantityPerUnit: return "QuantityPerUnit"; case ProductColumn.UnitPrice: return "UnitPrice"; case ProductColumn.UnitsInStock: return "UnitsInStock"; case ProductColumn.UnitsOnOrder: return "UnitsOnOrder"; case ProductColumn.ReorderLevel: return "ReorderLevel"; case ProductColumn.Discontinued: return "Discontinued"; } throw new InvalidOperationException("Invalid Enumeration Value"); }