예제 #1
0
        public static Item createITEM(ItemService IS, long catID, long numSchemeID, StringArray[] ItemNSFieldInputsDef, string itemTitle, string itemDesc)
        {
            try
            {
                GenVaultHelper.LibNotes();

                itemObj = IS.AddItemRevision(catID);
                ProductRestric[] pres;
                mID = new[] { itemObj.MasterId };
                sID = new[] { numSchemeID };
                rID = new[] { itemObj.RevId };

                ItemNum[] newNumbers = IS.AddItemNumbers(mID, sID, ItemNSFieldInputsDef, out pres);
                itemObj.ItemNum = newNumbers[0].ItemNum1;
                string[] itemNums = { itemObj.ItemNum };
                itemObj.Detail = itemTitle;
                itemObj.Title  = itemDesc;
                IS.CommitItemNumbers(mID, itemNums);
                IS.UpdateAndCommitItems(new Item[] { itemObj });
            }
            catch (System.Exception ex)
            {
                //return ex.ToString();
            }
            return(itemObj);// result = "Sucess";
        }
예제 #2
0
 public static void updateITEMPropbyName(VDF.Vault.Currency.Connections.Connection connection, Item item, string PropName, string propValue)
 {
     try
     {
         using (WebServiceManager wServ = connection.WebServiceManager) //using will log out after usage
         {
             ItemService IS       = wServ.ItemService;
             PropDef     propDefs = getPropertyDefDetails(connection, "ITEM", PropName);
             var         editITEM = IS.EditItems(new long[] { item.RevId })[0];
             GenVaultHelper.LibNotes();
             rID = new[] { editITEM.RevId };
             PropInstParam PIP = new PropInstParam()
             {
                 PropDefId = propDefs.Id, Val = propValue
             };
             Item[] uitem = IS.UpdateItemProperties(rID, new PropInstParamArray[] { new PropInstParamArray()
                                                                                    {
                                                                                        Items = new PropInstParam[] { PIP }
                                                                                    } });
             IS.UpdateAndCommitItems(uitem); //IS.UpdateAndCommitItems(new Item[] { item });
             //IS.DeleteUncommittedItems(false);
         }
     }
     catch (System.Exception ex)
     {
         //return ex.ToString();
     }
 }
예제 #3
0
 public static Item[] updateITEM(ItemService IS, Item item, long PropDefID, string propValue)
 {
     try
     {
         var editITEM = IS.EditItems(new long[] { item.RevId })[0];
         GenVaultHelper.LibNotes();
         rID = new[] { editITEM.RevId };
         PropInstParam PIP = new PropInstParam()
         {
             PropDefId = PropDefID, Val = propValue
         };
         Item[] uitem = IS.UpdateItemProperties(rID, new PropInstParamArray[] { new PropInstParamArray()
                                                                                {
                                                                                    Items = new PropInstParam[] { PIP }
                                                                                } });
         IS.UpdateAndCommitItems(uitem); //IS.UpdateAndCommitItems(new Item[] { item });
         //IS.DeleteUncommittedItems(false);
     }
     catch (System.Exception ex)
     {
         //return ex.ToString();
     }
     return(itemObjs);
 }