Пример #1
0
 private void detach_Messages(Message entity)
 {
     this.SendPropertyChanging();
     entity.Message1 = null;
 }
Пример #2
0
        public static long SaveMessage(string body, string flag, long? ParentId, File[] files,bool ishotnews)
        {
            var db = DCFactory.GetDataContext<BasicDataContext>();
            var msg = new Message
            {
                Body = body,
                CreatedBy = flag == MessageFlag.SystemMessage ? "SYSTEM" : UserHelper.IsDealer ? UserHelper.DealerCode : UserHelper.Username,
                CreatedDate = DateTime.Now,
                Flag = flag,
                ParentId = ParentId,
                Type= MessageType.NormalMessage
            };
            if (ishotnews)
                msg.Type = MessageType.HotMesssage;
            if (files != null)
            {
                foreach (var item in files)
                    if (item != null)
                        item.Message = msg;
            }

            db.Messages.InsertOnSubmit(msg);
            db.SubmitChanges();

            return msg.MessageId;
        }
Пример #3
0
 private void attach_Messages(Message entity)
 {
     this.SendPropertyChanging();
     entity.Message1 = this;
 }