private void detach_Messages(Message entity) { this.SendPropertyChanging(); entity.Message1 = null; }
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; }
private void attach_Messages(Message entity) { this.SendPropertyChanging(); entity.Message1 = this; }