Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CompanyService actCmp = Git_DIApi.VCmp.GetCompanyService();
- ActivitiesService actService = (ActivitiesService)actCmp.GetBusinessService(ServiceTypes.ActivitiesService);
- Activity act = (Activity)actService.GetDataInterface(ActivitiesServiceDataInterfaces.asActivity);
- try
- { ActivityParams oParams;
- act.Activity = BoActivities.cn_Task;
- act.ActivityType = -1; //"1 Продажи"
- act.Subject = 50; //"Follow Up"
- act.CardCode = CardCode;
- act.ContactPersonCode = CntctCode;
- act.HandledBy = SlpCode;
- act.Notes = "";
- DateTime now = DateTime.Now;
- DateTime startDate = now.AddDays(3);
- DateTime endDate = now.AddDays(10);
- act.ActivityDate = now;
- act.ActivityTime = now;
- act.StartDate = startDate;
- act.StartTime = startDate;
- act.EndDuedate = endDate;
- act.EndTime = endDate;
- act.DocType = ObjTypeQt;
- act.DocEntry = DocId;
- act.SalesOpportunityId = OpprId; // ! Linking an Activity
- act.SalesOpportunityLine = Line; // !
- oParams = actService.AddActivity(act);
- int ActCode = oParams.ActivityCode;
- }
- catch(Exception ex)
- { BubbleEvent = false;
- errMsg = "Ошибка при добавлении активности: " + ex.Message;
- }
- finally
- { Marshal.ReleaseComObject(actCmp); actCmp = null;
- Marshal.ReleaseComObject(actService); actService = null;
- Marshal.ReleaseComObject(act); act = null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement