/// <summary> /// US:1883 update a collection item /// </summary> /// <param name="di"></param> /// <returns></returns> public CStatus UpdateItemCollection(CItemCollectionDataItem di) { //create a status object and check for valid dbconnection CStatus status = DBConnValid(); if (!status.Status) { return(status); } //load the paramaters list CParameterList pList = new CParameterList(SessionID, ClientIP, UserID); // procedure specific parameters pList.AddInputParameter("pi_nCollectionItemID", di.CollectionItemID); pList.AddInputParameter("pi_nItemID", di.ItemID); pList.AddInputParameter("pi_nSortOrder", di.SortOrder); //execute the SP status = DBConn.ExecuteOracleSP("PCK_ITEM_COLLECTION.UpdateItemCollection", pList); if (!status.Status) { return(status); } return(new CStatus()); }
/// <summary> /// US:1883 /// override /// saves the item collection to the database /// </summary> /// <returns></returns> public override CStatus SaveControl() { CStatus status = DeleteChildItems(); if (!status.Status) { return(status); } foreach (DataRow dr in CollectionItems.Rows) { CItemCollectionDataItem di = new CItemCollectionDataItem(); di.CollectionItemID = Convert.ToInt64(dr["COLLECTION_ITEM_ID"]); di.ItemID = Convert.ToInt64(dr["ITEM_ID"]); di.SortOrder = Convert.ToInt64(dr["SORT_ORDER"]); CItemCollectionData itemCollection = new CItemCollectionData(BaseMstr.BaseData); if (di.CollectionItemID < 1) { di.CollectionItemID = LongID; status = itemCollection.InsertItemCollection(di); if (!status.Status) { return(status); } dr["COLLECTION_ITEM_ID"] = LongID; } else { status = itemCollection.UpdateItemCollection(di); if (!status.Status) { return(status); } } } return(new CStatus()); }
/// <summary> /// US:1883 get the item collection DI /// </summary> /// <param name="lCollectionItemID"></param> /// <param name="lItemID"></param> /// <param name="di"></param> /// <returns></returns> public CStatus GetItemCollectionDI(long lCollectionItemID, long lItemID, out CItemCollectionDataItem di) { //initialize parameters di = null; //create a status object and check for valid dbconnection CStatus status = DBConnValid(); if (!status.Status) { return(status); } //load the paramaters list CParameterList pList = new CParameterList(SessionID, ClientIP, UserID); // procedure specific parameters pList.AddInputParameter("pi_nCollectionItemID", lCollectionItemID); pList.AddInputParameter("pi_nItemID", lItemID); //get the dataset CDataSet cds = new CDataSet(); DataSet ds = null; status = cds.GetOracleDataSet( DBConn, "PCK_ITEM_COLLECTION.GetItemCollectionDI", pList, out ds); if (!status.Status) { return(status); } di = new CItemCollectionDataItem(ds); return(new CStatus()); }