public void SendMessage() { TextCorpMessage message = new TextCorpMessage(MessageText); switch (Target) { case CorpSendTarget.All: message.SetAllUser(); break; case CorpSendTarget.Tag: message.SetTag(TagId.Value <int>()); break; case CorpSendTarget.Department: message.SetParty(DepartmentId.Value <int>()); break; case CorpSendTarget.User: message.SetUser(UserId); break; } message.Send(AppId); }