protected void TranslateOrder(CatalogDevicePlan devicePlan, CatalogDevicePlanNode devicePlanNode, TableNode tableNode) { if (devicePlanNode.WhereCondition.Length > 0) { devicePlanNode.Statement.AppendFormat(" where {0}", devicePlanNode.WhereCondition.ToString()); } if ((tableNode.Order != null) && (tableNode.Order.Columns.Count > 0)) { devicePlanNode.Statement.AppendFormat(" order by "); for (int index = 0; index < tableNode.Order.Columns.Count; index++) { OrderColumn orderColumn = tableNode.Order.Columns[index]; if (index > 0) { devicePlanNode.Statement.Append(", "); } if (devicePlan.TableContext != null) { devicePlanNode.Statement.Append(Schema.Object.EnsureUnrooted(MetaData.GetTag(devicePlan.TableContext.Columns[orderColumn.Column.Name].MetaData, "Storage.Name", orderColumn.Column.Name))); } else { devicePlanNode.Statement.Append(Schema.Object.EnsureUnrooted(orderColumn.Column.Name)); } if (!orderColumn.Ascending) { devicePlanNode.Statement.Append(" desc"); } } } }
private void Stack(Program program, Database db, Order order, Order key, TableNode node) { _key = key; OrderColumn column = order.Columns[order.Columns.Count - 1]; _direction = column.Ascending ? ScanDirection.Forward : ScanDirection.Backward; _order = new Order(); _order.Columns.Add(column); _nestedOrder = new Order(); for (int i = 0; i < order.Columns.Count - 1; i++) { _nestedOrder.Columns.Add(order.Columns[i]); } _nestedComparer = new RowComparer(_nestedOrder.Columns[_nestedOrder.Columns.Count - 1], Program.ValueManager); _comparer = new RowComparer(_order.Columns[0], Program.ValueManager); if (_nestedOrder.Columns.Count == 1) { FastoreCursor scan = new FastoreCursor(program, db, node); scan.Key = key; scan.Direction = _nestedOrder.Columns[0].Ascending ? ScanDirection.Forward : ScanDirection.Backward; scan.Node.Order = _nestedOrder; _nestedTable = scan; } else { _nestedTable = new FastoreStackedCursor(program, db, _nestedOrder, key, node); } }
public virtual ActionResult ListControl(int pageIndex, OrderColumn orderColumn) { var currentFilterValues = GetCurrentFilterValues(); var items = AddFilterToList(currentFilterValues); if (!orderColumn.ColumnName.IsEmpty()) { var orderQuery = orderColumn.ColumnName; if (orderColumn.IsDesc) { orderQuery += " " + Const.Common.Descending; } items = items.OrderBy(orderQuery); } var tableData = new List <ListVM.Row>(); var pagedList = items.ToPagedList(pageIndex - 1); foreach (var item in pagedList) { var id = LinqToSqlUtils.GetPK(item); var list = GetValuesForRow(item); tableData.Add(new ListVM.Row { Id = id, Entity = item, Values = list }); } var listVM = new ListVM(MetaData, pagedList, tableData); AddExtraControls(listVM, true); listVM.FilterValues = currentFilterValues; listVM.OrderColumn = orderColumn; return(View(PartialViewNames.ListControl, listVM)); }
//노트 리스트 public ActionResult NoteListByOrder(OrderColumn orderColumn, OrderType orderType) { OrderColumn defaultOrderColumn = OrderColumn.Notedate; OrderType defaultOrderType = OrderType.Desc; int defaultNoteBookId = 0; OrderColumn selectedOrderColumn; OrderType selectedOrderType; if (String.IsNullOrEmpty(orderColumn.ToString())) { // parameter is empty //selectedOrderColumn = defaultOrderColumn; if (Session["OrderColumn"] != null) { // do nothing } else { // use default value Session["OrderColumn"] = defaultOrderColumn; } } else { // parameter is delivered by user selectedOrderColumn = (OrderColumn)Enum.Parse(typeof(OrderColumn), orderColumn.ToString()); Session["OrderColumn"] = selectedOrderColumn; } if (String.IsNullOrEmpty(orderType.ToString())) { // parameter is empty //selectedOrderColumn = defaultOrderColumn; if (Session["OrderType"] != null) { // do nothing } else { // use default value Session["OrderType"] = defaultOrderType; } } else { // parameter is delivered by user selectedOrderType = (OrderType)Enum.Parse(typeof(OrderType), orderType.ToString()); Session["OrderType"] = selectedOrderType; } //var noteList = NoteDAO.GetNoteList((OrderColumn)Session["OrderColumn"], (OrderType)Session["OrderType"], defaultNoteBookId); return(View()); }
public virtual ActionResult List(int pageIndex, OrderColumn orderColumn) { var currentFilterValues = GetCurrentFilterValues(); var items = AddFilterToList(currentFilterValues); if (orderColumn.ColumnName.IsEmpty()) { if (MetaData.EntityType.HasProperty(UpdateDate)) { orderColumn = new OrderColumn { IsDesc = true, ColumnName = UpdateDate, }; } else { orderColumn = new OrderColumn { IsDesc = true, ColumnName = LinqToSqlUtils.GetPKPropertyName(MetaData.EntityType) } }; } if (!orderColumn.ColumnName.IsEmpty()) { var orderQuery = orderColumn.ColumnName; if (orderColumn.IsDesc) { orderQuery += " " + Const.Common.Descending; } items = items.OrderBy(orderQuery); } items = OnListSelecting(items); var tableData = new List <ListVM.Row>(); var pagedList = items.ToPagedList(pageIndex - 1); foreach (var item in pagedList) { var id = LinqToSqlUtils.GetPK(item); var list = GetValuesForRow(item); tableData.Add(new ListVM.Row { Id = id, Entity = item, Values = list }); } var listVM = new ListVM(MetaData, pagedList, tableData); AddExtraControls(listVM, true); listVM.FilterValues = currentFilterValues; listVM.OrderColumn = orderColumn; ListVMCreated(listVM); return(View(listVM)); }
public ActionResult Detail(string id) { var logger = NLog.LogManager.GetCurrentClassLogger(); logger.Info("로그 테스트입니다."); NoteIndexVM model = new NoteIndexVM(); //int id; //노트아이디 OrderColumn defaultOrderColumn = OrderColumn.Notedate; OrderType defaultOrderType = OrderType.Desc; OrderColumn selectedOrderColumn; OrderType selectedOrderType; if (Session["OrderColumn"] != null) { selectedOrderColumn = (OrderColumn)Enum.Parse(typeof(OrderColumn), Session["OrderColumn"].ToString()); } else { // use default value selectedOrderColumn = defaultOrderColumn; } if (Session["OrderType"] != null) { selectedOrderType = (OrderType)Enum.Parse(typeof(OrderType), Session["OrderType"].ToString()); } else { // use default value selectedOrderType = defaultOrderType; } model.NoteList = NoteDAO.GetNoteList((OrderColumn)selectedOrderColumn, (OrderType)selectedOrderType, 0); if (String.IsNullOrEmpty(id)) { model.SelectedNote = NoteDAO.GetNotebyId(model.NoteList[0].NoteId); id = model.SelectedNote.NoteId.ToString(); return(RedirectToAction("detail", new { id = id })); } model.SelectedNote = NoteDAO.GetNotebyId(int.Parse(id)); //노트북선택 SelectNoteBook(int.Parse(id)); //노트 아이디로 노트북 얻어옴 model.NoteBook = NoteBookDAO.GetNoteBookbyId(model.SelectedNote.NoteBookId); return(View(model)); }
public PagedResult <User> Search(IEnumerable <User> users) { // Get total record count long total = users.LongCount(); // Filtering if (!string.IsNullOrEmpty(SearchPattern)) { // Find by name users = users.Where(u => u.FirstName.StartsWith(SearchPattern) || u.LastName.StartsWith(SearchPattern) || u.Email.StartsWith(SearchPattern) || u.Phone.StartsWith(SearchPattern)); } // Get count after filtering long filteredCount = users.LongCount(); // Order switch (OrderColumn?.ToLower()) { case "firstname": users = users.Order(u => u.FirstName, SortOrder); break; case "lastname": users = users.Order(u => u.LastName, SortOrder); break; case "role": users = users.Order(u => u.Role.ToString(), SortOrder); break; case "email": users = users.Order(u => u.Email, SortOrder); break; case "phone": users = users.Order(u => u.Phone, SortOrder); break; case "isactive": users = users.Order(u => u.IsActive, SortOrder); break; default: users = users.Order(u => u.Id, SortOrder); break; } users = users.Skip(Offset).Take(Limit); return(new PagedResult <User>(users.ToList(), Offset, Limit, total, filteredCount)); }
public virtual async Task <ActionResult> List(int?pagesize, int?start, string order) { if (Entities == null) { throw new ArgumentNullException("Entities", "没有未模型配置数据集"); } var q = InternalBeforeListSearch(); var total = await q.CountAsync(); List <OrderColumn> orderColumns = new List <OrderColumn>(); if (!String.IsNullOrEmpty(order) && !String.IsNullOrWhiteSpace(order)) { var orders = order.Split(','); foreach (var _order in orders) { var column = new OrderColumn(); var exp = _order.Split('_'); column.Name = exp[0]; if (exp.Count() > 1) { column.SetDir(exp[1]); } orderColumns.Add(column); } } q = this.PrepareListOrder(orderColumns, q); pagesize = pagesize == null ? 15 : pagesize; start = start == null ? 0 : start; List <TEntity> list = null; if (pagesize == -1) { list = await Entities.ToListAsync(); } else { list = await Entities.OrderByDescending(e => e.Id).Skip(start.Value).Take(pagesize.Value).ToListAsync(); } list = await this.InternalBeforeListReturnDataAsync(list); return(Json(new { data = list, count = total })); }
public OrderColumnDetail GetColumnDetails(int AIndex) { OrderColumn LColumn = FOrder.Columns[AIndex]; OrderColumnDetail LResult = new OrderColumnDetail(); LResult.Ascending = LColumn.Ascending; LResult.IsDefaultSort = LColumn.IsDefaultSort; if (LColumn.IsDefaultSort) { LResult.OrderExpression = String.Empty; } else { LResult.OrderExpression = new DAE.Language.D4.D4TextEmitter().Emit(LColumn.Sort.EmitStatement(DAE.Language.D4.EmitMode.ForCopy)); } return(LResult); }
/// <summary> /// 设置排序 /// </summary> public SimpleQuery OrderBy(string _IOrderColumn) { List <string> _OrderInfo = _IOrderColumn.SplitString(",").ToList(); if (_IOrderColumn.IsNotNullOrEmpty()) { OrderColumn = string.Empty; OrderDirection = string.Empty; foreach (string _FKOrderKey in _OrderInfo) { string _Col = string.Empty; string _Dir = string.Empty; if (_FKOrderKey.SplitString(" ").Length == 2) { _Col = _FKOrderKey.SplitString(" ")[0].Trim(); _Dir = _FKOrderKey.SplitString(" ")[1].Trim(); if (_Dir.ToUpper() != "ASC" && _Dir.ToUpper() != "DESC") { _Dir = "ASC"; } } else if (_FKOrderKey.SplitString(" ").Length == 1 && _FKOrderKey.IndexOf(" ") < 0) { _Col = _FKOrderKey.Trim(); _Dir = "ASC"; } if (_Col.IsNotNullOrEmpty() && _Dir.IsNotNullOrEmpty()) { OrderColumn += _Col + ","; OrderDirection += _Dir + ","; } } OrderColumn = OrderColumn.RemoveEndChar(","); OrderDirection = OrderDirection.RemoveEndChar(","); } return(this); }
public PagedResult <Product> Search(IEnumerable <Product> products) { // Get total record count long total = products.LongCount(); // Filtering if (!string.IsNullOrEmpty(SearchPattern)) { // Find by name products = products.Where(p => p.Name.StartsWith(SearchPattern)); } // Get count after filtering long filteredCount = products.LongCount(); // Order switch (OrderColumn?.ToLower()) { case "name": products = products.Order(p => p.Name, SortOrder); break; case "quantity": products = products.Order(p => p.Quantity, SortOrder); break; case "sku": products = products.Order(p => p.Sku, SortOrder); break; default: products = products.Order(p => p.Id, SortOrder); break; } products = products.Skip(Offset).Take(Limit); return(new PagedResult <Product>(products.ToList(), Offset, Limit, total, filteredCount)); }
public RowComparer(OrderColumn column, IValueManager manager) { _order = column; _manager = manager; }
protected JsonResult ListarJqGrid <T, TResult>(ListParameter <T, TResult> configuracionListado) where T : EntityBase where TResult : class { try { GridTable grid = configuracionListado.Grid; Expression <Func <T, bool> > where = LambdaFilterManager.ConvertToLambda <T>(grid.Columns, grid.Search, grid.Homologaciones) .And(configuracionListado.FiltrosAdicionales ?? (q => true)); var count = configuracionListado.CountMethod(where); OrderColumn ordenamiento = grid.Order.First(); var currentPage = (grid.Start / grid.Length); var parametroFiltro = new FilterParameters <T> { ColumnOrder = grid.Columns[ordenamiento.Column].Name, CurrentPage = (currentPage >= 0 ? currentPage : 0) + 1, OrderType = ordenamiento.Dir != null ? (TipoOrden)Enum.Parse(typeof(TipoOrden), ordenamiento.Dir, true) : TipoOrden.Asc, WhereFilter = where, AmountRows = grid.Length > 0 ? grid.Length : count }; int totalPages = 0; if (count > 0 && parametroFiltro.AmountRows > 0) { if (count % parametroFiltro.AmountRows > 0) { totalPages = count / parametroFiltro.AmountRows + 1; } else { totalPages = count / parametroFiltro.AmountRows; } totalPages = totalPages == 0 ? 1 : totalPages; } parametroFiltro.CurrentPage = parametroFiltro.CurrentPage > totalPages ? totalPages : parametroFiltro.CurrentPage; parametroFiltro.Start = grid.Start; List <TResult> respuestaList = configuracionListado.ListMethod(parametroFiltro) .ToList() .Select(configuracionListado.SelecctionFormat).ToList(); var responseData = new DataTableResponse <TResult> { data = respuestaList, recordsFiltered = count, recordsTotal = count }; return(Json(responseData)); } catch (Exception ex) { LogError(ex); return(MensajeError()); } }
/// <summary> /// 목적 : 인덱스 페이지에서 노트리스트를 최근순으로 불러옴 /// 준비물 : 노트리스트, db커넥션 /// (1) 빈 노트리스트와 db커넥션을 생성. /// (2) isdeleted의 값이 0인(삭제되지 않은) 노트를 불러오는 쿼리 작성. /// (3) 불러온 노트를 노트리스트에 넣고 커넥션과 reader를 닫아준다. /// </summary> /// <param name="orderColumnName">"notedate" | "title"</param> /// <param name="orderType">"ASC" | "DESC"</param> /// <param name="noteBookId"></param> /// <returns></returns> public static List <NoteVO> GetNoteList(OrderColumn orderColumnName, OrderType orderType, int noteBookId) { List <NoteVO> noteList = new List <NoteVO>(); OracleConnection conn = DbHelper.NewConnection(); conn.Open(); StringBuilder sbQuery = new StringBuilder(); sbQuery.Append("\n SELECT "); sbQuery.Append("\n noteid, "); sbQuery.Append("\n title, "); sbQuery.Append("\n contents, "); sbQuery.Append("\n notedate, "); sbQuery.Append("\n TO_CHAR(notedate,'YYMMDD')AS yymmdd "); sbQuery.Append("\n FROM "); sbQuery.Append("\n note "); if (noteBookId == 0) //삭제 되지 않은 노트 전체 { sbQuery.Append("\n WHERE isdeleted = 0 "); } else if (noteBookId == -1) //휴지통에 있는 노트 전체 { sbQuery.Append("\n WHERE isdeleted = 1 "); } else { sbQuery.Append("\n WHERE isdeleted = 0 "); sbQuery.Append("\n AND notebookid = " + noteBookId); } sbQuery.Append($"\n order by {orderColumnName} {orderType}"); String sql = sbQuery.ToString(); OracleCommand cmd = new OracleCommand { Connection = conn, CommandText = sql }; OracleDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { NoteVO note = new NoteVO { NoteId = int.Parse(reader["NOTEID"].ToString()), Title = reader["TITLE"].ToString(), Contents = reader["CONTENTS"] as String, NoteDate = reader["YYMMDD"].ToString(), FullDate = Convert.ToDateTime(reader["NOTEDATE"]) }; noteList.Add(note); DateTime today = DateTime.Now; DateTime theDay = note.FullDate; TimeSpan diff = today.Subtract(theDay); if (diff.Days < 21) { note.NoteDate = "2주 전"; if (diff.Days < 14) { note.NoteDate = "1주 전"; if (diff.Days < 7) { note.NoteDate = diff.Days.ToString() + "일 전"; if (diff.Days < 1) { note.NoteDate = diff.Hours.ToString() + "시간 전"; if (diff.Hours < 1) { note.NoteDate = diff.Minutes.ToString() + "분 전"; if (diff.Minutes < 1) { note.NoteDate = diff.Seconds.ToString() + "초 전"; } } } } } } else { note.NoteDate = note.FullDate.ToString(); //note.NoteDate = note.FullDate.ToString("yy. M. d."); } } reader.Close(); conn.Close(); return(noteList); }
/// <summary> /// 为Action List 准备排序,支持DateTime,String,Int,Double /// </summary> /// <param name="id"></param> /// <param name="req"></param> /// <param name="Items"></param> /// <returns></returns> protected virtual IQueryable <TEntity> PrepareListOrder(List <OrderColumn> OrderColumns, IQueryable <TEntity> Items) { var ret = InternalBeforeListOrder(OrderColumns, Items); if (this.Queryable != null) { Items = this.Queryable; } if (ret != "DONE") { #region ===== 排序 ===== IOrderedQueryable <TEntity> oq = null; //排序 for (int i = 0; i < OrderColumns.Count; i++) { OrderColumn od = OrderColumns[i]; foreach (var prop in (typeof(TEntity)).GetProperties()) { Type PropertyType = prop.PropertyType; var PropertyTypeFullName = PropertyType.FullName; if (od.Name == prop.Name) { var param = Expression.Parameter(typeof(TEntity), prop.Name); var body = Expression.Property(param, prop.Name); if (PropertyTypeFullName == typeof(System.DateTime).FullName) { var keySelector = Expression.Lambda <Func <TEntity, System.DateTime> >(body, param); if (od.Dir == OrderColumn.Direction.Asc) { oq = oq == null?Items.OrderBy(keySelector) : oq.ThenBy(keySelector); } else { oq = oq == null?Items.OrderByDescending(keySelector) : oq.ThenByDescending(keySelector); } } else if (PropertyTypeFullName == typeof(Nullable <System.DateTime>).FullName) { var keySelector = Expression.Lambda <Func <TEntity, Nullable <System.DateTime> > >(body, param); if (od.Dir == OrderColumn.Direction.Asc) { oq = oq == null?Items.OrderBy(keySelector) : oq.ThenBy(keySelector); } else { oq = oq == null?Items.OrderByDescending(keySelector) : oq.ThenByDescending(keySelector); } } else if (PropertyTypeFullName == typeof(System.String).FullName) { var keySelector = Expression.Lambda <Func <TEntity, System.String> >(body, param); if (od.Dir == OrderColumn.Direction.Asc) { oq = oq == null?Items.OrderBy(keySelector) : oq.ThenBy(keySelector); } else { oq = oq == null?Items.OrderByDescending(keySelector) : oq.ThenByDescending(keySelector); } } else if (PropertyTypeFullName == typeof(System.Int32).FullName) { var keySelector = Expression.Lambda <Func <TEntity, System.Int32> >(body, param); if (od.Dir == OrderColumn.Direction.Asc) { oq = oq == null?Items.OrderBy(keySelector) : oq.ThenBy(keySelector); } else { oq = oq == null?Items.OrderByDescending(keySelector) : oq.ThenByDescending(keySelector); } } else if (PropertyTypeFullName == typeof(System.Double).FullName) { var keySelector = Expression.Lambda <Func <TEntity, System.Double> >(body, param); if (od.Dir == OrderColumn.Direction.Asc) { oq = oq == null?Items.OrderBy(keySelector) : oq.ThenBy(keySelector); } else { oq = oq == null?Items.OrderByDescending(keySelector) : oq.ThenByDescending(keySelector); } } break; } } } if (oq != null) { Items = oq; } else { Items = Items.OrderByDescending(e => new { e.Id }); } #endregion ===== 排序 ===== } ret = InternalAfterListOrder(OrderColumns, Items); return(Items); }
/// <summary> /// Get products by seller id /// </summary> /// <param name="sellerId">Seller Id</param> /// <param name="pageNumber">Page number (pagination)</param> /// <param name="rowsCount">Count of products per page</param> /// <param name="currency">Currency for prices</param> /// <param name="orderColumn">Sorting column</param> /// <param name="orderDir">Sorting by</param> /// <param name="language">Language information</param> /// <returns></returns> public async Task <Interfaces.SellerProducts.ISellerProducts> GetSellerProducts(int sellerId, int pageNumber = 1, int rowsCount = 20, Currency currency = Currency.RUR, OrderColumn orderColumn = OrderColumn.Name, OrderDir orderDir = OrderDir.Asc, Language language = Language.Russian) { var request = new DigisellerSellerProductsRequest(sellerId, orderColumn.ToString().ToLower(), orderDir.ToString().ToLower(), rowsCount, pageNumber, currency.ToString(), _languages[language]); var response = await GetDigisellerDataAsync(request, new XmlSerializer <DigisellerSellerProductsRequest, DigisellerSellerProductsResponseXml>(), UrlGetSellerGoods); return(response != null ? new SellerProducts(response) : null); }
/// <summary> /// Get products by current seller /// </summary> /// <param name="pageNumber">Page number (pagination)</param> /// <param name="rowsCount">Count of products per page</param> /// <param name="currency">Currency for prices</param> /// <param name="orderColumn">Sorting column</param> /// <param name="orderDir">Sorting by</param> /// <param name="language">Language information</param> /// <returns></returns> public async Task <Interfaces.SellerProducts.ISellerProducts> GetSellerProducts(int pageNumber = 1, int rowsCount = 20, Currency currency = Currency.RUR, OrderColumn orderColumn = OrderColumn.Name, OrderDir orderDir = OrderDir.Asc, Language language = Language.Russian) { return(await GetSellerProducts(SellerId, pageNumber, rowsCount, currency, orderColumn, orderDir, language)); }
public ActionResult List(string orderColumn, string orderType, string noteId, string tagId) { OrderColumn defaultOrderColumn = OrderColumn.Notedate; OrderType defaultOrderType = OrderType.Desc; OrderColumn selectedOrderColumn; OrderType selectedOrderType; int selectedTagId; if (String.IsNullOrEmpty(orderColumn)) { // parameter is empty //selectedOrderColumn = defaultOrderColumn; if (Session["OrderColumn"] != null) { // do nothing } else { // use default value Session["OrderColumn"] = defaultOrderColumn; } } else { // parameter is delivered by user selectedOrderColumn = (OrderColumn)Enum.Parse(typeof(OrderColumn), orderColumn); Session["OrderColumn"] = selectedOrderColumn; } if (String.IsNullOrEmpty(orderType)) { // parameter is empty //selectedOrderColumn = defaultOrderColumn; if (Session["OrderType"] != null) { // do nothing } else { // use default value Session["OrderType"] = defaultOrderType; } } else { // parameter is delivered by user selectedOrderType = (OrderType)Enum.Parse(typeof(OrderType), orderType); Session["OrderType"] = selectedOrderType; } //Tagid selectedTagId = int.Parse(tagId); var noteList = TagDAO.GetNoteListByTagId(selectedTagId); // 리스트 정렬 정보 (column, asc|desc) // note detail int selectedNoteid = noteList[0].NoteId; NoteVO selectedNote = NoteDAO.GetNotebyId(selectedNoteid); NoteIndexVM model = new NoteIndexVM(); model.NoteList = noteList; model.SelectedNote = selectedNote; int notebookIdParsedInt = int.Parse(tagId); model.NoteBook = NoteBookDAO.GetNoteBookbyId(notebookIdParsedInt); //바로가기 여부 보여줌 //ViewBag.isShortCut = ShortcutManager.IsShorcut(id, 1); return(View(model)); }
public static string GetColumnName(OrderColumn column) { switch (column) { case OrderColumn.OrderID: return "OrderID"; case OrderColumn.CustomerID: return "CustomerID"; case OrderColumn.EmployeeID: return "EmployeeID"; case OrderColumn.OrderDate: return "OrderDate"; case OrderColumn.RequiredDate: return "RequiredDate"; case OrderColumn.ShippedDate: return "ShippedDate"; case OrderColumn.ShipVium: return "ShipVia"; case OrderColumn.Freight: return "Freight"; case OrderColumn.ShipName: return "ShipName"; case OrderColumn.ShipAddres: return "ShipAddress"; case OrderColumn.ShipCity: return "ShipCity"; case OrderColumn.ShipRegion: return "ShipRegion"; case OrderColumn.ShipPostalCode: return "ShipPostalCode"; case OrderColumn.ShipCountry: return "ShipCountry"; } throw new InvalidOperationException("Invalid Enumeration Value"); }