protected override object AddNewCore() { IInvolvedPerson person1 = new InvolvedPerson(); base.Add(person1); return(person1); }
protected override object AddNewCore() { IInvolvedPerson involvedPerson = new InvolvedPerson(); Add(involvedPerson); // Not necessary to hook up event handlers, base class calls InsertItem return(involvedPerson); }
public static int SendAutomationMessageWithAttachment(string _Subject, string _MSG, string[] _MainPersonalID, string[] _CopyPersonID, String _FileName, string _FileExtention, byte[] ExcelAttachment) { int SuccessSendCount = 0; try { // send AutoMsg with سیستم مدیریت کیفی خودرو PostItemService ps = new PostItemService(); //ipid[0]. var postItem = new PostItem { Subject = _Subject, Description = _MSG, ImportanceType = ImportanceType.Normal }; string Pid = ""; Participant participant; SendPostItemType returnType; InvolvedPerson[] lstP = new InvolvedPerson[_MainPersonalID.Length + _CopyPersonID.Length]; int PIndex = 0; for (int i = 0; i < _MainPersonalID.Length; i++) { Pid = _MainPersonalID[i]; participant = ps.FindPersonalNo("product", "percamp0082397171", Pid); if (participant != null) { lstP[PIndex++] = new InvolvedPerson { InvolvedParticipantID = participant.Id, InvolvedType = InvolvedType.MainReceiver }; } } for (int j = 0; j < _CopyPersonID.Length; j++) { Pid = _CopyPersonID[j]; participant = ps.FindPersonalNo("product", "percamp0082397171", Pid); if (participant != null) { lstP[PIndex++] = new InvolvedPerson { InvolvedParticipantID = participant.Id, InvolvedType = InvolvedType.CopyReceiver }; } } //--- postItem.InvolvedPersonList = lstP; Attachment att = new Attachment(); att.FileName = _FileName; att.FileExtention = _FileExtention; att.FileContent = ExcelAttachment; Attachment[] at = new Attachment[1]; at[0] = att; postItem.AttachmentList = at; returnType = ps.SendPostItem("product", "percamp0082397171", postItem); if (returnType == SendPostItemType.SendSuccessful) { SuccessSendCount++; } return(SuccessSendCount); } catch { return(SuccessSendCount); } }
public bool SendMail(decimal IdSender, decimal?IdReceiverTemp, decimal IdPack, string InSubject, string InDescription) { try { if (IdReceiverTemp == null) { return(false); } var IdReceiver = (decimal)IdReceiverTemp; //if (IdPack == null) //{ // ItemsPublic.Exeptor("بسته ورودی نامشخص است"); //} //if (IdReceiver == null) //{ // ItemsPublic.Exeptor("گیرنده پیام نامشخص است"); //} // IdPack = (decimal)IdPack; string TicketID = UserContext.TicketID; PostItem mail = new PostItem(true); // MessageBox.Show(mail.GetID().ToString()); mail.Subject = InSubject;// "درخواست مجوز عبور"; mail.StateDate = DateTime.Now; mail.Description = string.IsNullOrEmpty(InDescription) ? _sss : InDescription + "\r\n\r\n" + _sss; // return false; EOrgObject infoPack = new EOrgObject(true); infoPack.CreatorID = IdSender; // UserContext.CurrentUser.ID; infoPack.ObjectTypeID = _TypeGpBaridId; // عدد ثابت باید برای آبجکت های از نوع بسته های مجوز لحاظ شود infoPack.IsCreatedBySystem = true; infoPack.SensitivityLevel = (int)SensivityType.Normal; infoPack.ObjectID = IdPack; infoPack.OwnerID = IdSender; // UserContext.CurrentUser.ID; infoPack.AllowInheritablePermissions = true; IEOrgObjectFacade facade1 = SecurityProxyFactory.NewEOrgObjectFacade(); if (!facade1.IsExistObject(TicketID, IdPack)) { mail.ReferenceId = facade1.Create(TicketID, infoPack); } else { mail.ReferenceId = facade1.LoadObject(TicketID, IdPack).ObjectID; } InvolvedPersonList workFlowInvolvedPersonList = new InvolvedPersonList(); InvolvedPerson workFlowInvolvedPerson = new InvolvedPerson(true); IParticipantFacade participantFacade = DirectoryProxyFactory.NewParticipantFacade(); Participant defaultParticipant = participantFacade.GetDefaultParticipant(TicketID, IdReceiver); workFlowInvolvedPerson.PersonID = IdReceiver; workFlowInvolvedPerson.InvolvedTypeID = (int)InvolvedType.MainReceiver; workFlowInvolvedPerson.InvolvedParticipantID = defaultParticipant.ID; workFlowInvolvedPerson.OrganizationID = defaultParticipant.OrganizationUnitID; workFlowInvolvedPerson.DisplayString = defaultParticipant.PersonName + "(" + defaultParticipant.DisplayString + ")"; workFlowInvolvedPerson.PersonName = defaultParticipant.PersonName; workFlowInvolvedPerson.PositionName = defaultParticipant.PositionName; workFlowInvolvedPersonList.Add(workFlowInvolvedPerson); mail.InvolvedPersonList = workFlowInvolvedPersonList; IPostItemFacade facade = WorkflowProxyFactory.NewPostItemFacade(); decimal idResult = facade.Send(TicketID, mail, IdSender, true); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } return(true); }