|
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// The Common Usage For GridView (Version 7.0)
// Author: Behrouz Rad
// Copyright © 2006 - 2009, All rights reserved.
// feel free to contact me: behrouz.rad@gmail.com
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
namespace BehooGridViewFunctions.BLL.Orders
{
using System.Collections.Generic;
using BehooGridViewFunctions.DAL;
using BehooGridViewFunctions.Entities;
public class ChildPiece : BaseOrder
{
#region Constructor
///////////////////////////////////////////////////
// Constructor
///////////////////////////////////////////////////
public ChildPiece(int id, int privateId, string subPieceName)
{
this.ID = id;
this.PrivateID = privateId;
this.SubPieceName = subPieceName;
}
#endregion
#region Properties
///////////////////////////////////////////////////
// Properties
///////////////////////////////////////////////////
public int ID { get; set; }
public int PrivateID { get; set; }
public string SubPieceName { get; set; }
#endregion
#region Public Static Methods
///////////////////////////////////////////////////
// Public Static Methods
///////////////////////////////////////////////////
public static List<ChildPiece> GetChildPieces(int parentId)
{
List<EntityChildPiece> childPieces = SiteProvider.Orders.GetChildPieces(parentId);
List<ChildPiece> childPieceList = GetChildPieceListFromEntityChildPieceList(childPieces);
return childPieceList;
}
#endregion
#region Private Static Methods
///////////////////////////////////////////////////
// Private static Methods
///////////////////////////////////////////////////
private static ChildPiece GetChildPieceFromEntityChildPiece(EntityChildPiece childPiece)
{
if (childPiece == null)
{
return null;
}
else
{
return new ChildPiece(childPiece.ID, childPiece.PrivateID, childPiece.SubPieceName);
}
}
private static List<ChildPiece> GetChildPieceListFromEntityChildPieceList(List<EntityChildPiece> childPieceList)
{
List<ChildPiece> childPieces = new List<ChildPiece>();
foreach (EntityChildPiece childPiece in childPieceList)
{
childPieces.Add(GetChildPieceFromEntityChildPiece(childPiece));
}
return childPieces;
}
#endregion
#region Public Instance Methods
///////////////////////////////////////////////////
// Public Instance Methods
///////////////////////////////////////////////////
public override string ToString()
{
return this.ID + "," + this.SubPieceName + "," + this.PrivateID;
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.