示例#1
0
        /// <summary>
        /// A basic add example
        /// </summary>
        public EventsModel Add(string orgCode, string eventName, string accountCode)
        {
            var myEvent = new EventsModel
            {
                Organization = orgCode,
                Description  = eventName,
                Account      = accountCode,
                StartDate    = System.DateTime.Now,
                EndDate      = System.DateTime.Now,
            };

            return(APIUtil.AddEvent(USISDKClient, myEvent));
        }
示例#2
0
        public EventsModel AddWithUserFields(string orgCode, string eventName, string accountCode, string issueType, string newTxt12Value)
        {
            var myEvent = new EventsModel
            {
                Organization = orgCode,
                Description  = eventName,
                Account      = accountCode,
                StartDate    = System.DateTime.Now,
                EndDate      = System.DateTime.Now,
            };

            //Here's how to add a user field set with values to a new event
            myEvent.EventUserFieldSets = new List <UngerboeckSDKPackage.UserFields>();
            UngerboeckSDKPackage.UserFields myUserField = new UngerboeckSDKPackage.UserFields();

            //Note that class is always EventSales (C) and is automatically set in Ungerboeck.
            myUserField.Type       = issueType;          //Use the Opportunity Type code from your user field.  This matches the value stored in Ungerboeck table column CR073_ISSUE_TYPE.
            myUserField.UserText12 = newTxt12Value;      //Set the value in the user field property
            myEvent.EventUserFieldSets.Add(myUserField); //Then add it back into the EventModel object.  You can add multiple user field sets to the same event object before saving.

            return(APIUtil.AddEvent(USISDKClient, myEvent));
        }