public static Assets.AssetItem[] SelectAssetsToArray(int DeptID, int TicketId) { DataTable _dt = SelectAssets(DeptID, TicketId); Data.Assets.AssetItem[] _arr = new Assets.AssetItem[_dt.Rows.Count]; for (int i = 0; i < _dt.Rows.Count; i++) { if (_dt.Rows[i].IsNull("AssetId")) _arr[i] = new Assets.AssetItem(_dt.Rows[i]["SerialTagNumber"].ToString(), _dt.Rows[i]["Description"].ToString()); else _arr[i] = new Assets.AssetItem((int)_dt.Rows[i]["AssetId"], _dt.Rows[i]["Description"].ToString()); } return _arr; }
public static Assets.AssetItem[] SelectSubAssets(int departmentId, int assetId) { DataTable _dt = SelectRecords("sp_SelectSubAssets", new SqlParameter[] { new SqlParameter("@DepartmentId", departmentId), new SqlParameter("@AssetId", assetId) }); Data.Assets.AssetItem[] _arr = new Assets.AssetItem[_dt.Rows.Count]; for (int i = 0; i < _dt.Rows.Count; i++) _arr[i] = new Assets.AssetItem((int)_dt.Rows[i]["AssetChildId"], _dt.Rows[i]["Description"].ToString()); return _arr; }
public static Data.Assets.AssetItem[] SelectTicketAssets(int DeptID, int SchedTicketId) { DataTable _dt = SelectRecords("sp_SelectSchedTicketAssets", new SqlParameter[] { new SqlParameter("@DId", DeptID), new SqlParameter("@SchedTicketId", SchedTicketId) }); Data.Assets.AssetItem[] _arr = new Assets.AssetItem[_dt.Rows.Count]; for (int i = 0; i < _dt.Rows.Count; i++) _arr[i] = new Assets.AssetItem((int)_dt.Rows[i]["AssetId"], _dt.Rows[i]["Description"].ToString()); return _arr; }