Пример #1
0
        public int UpdateStatus(string[] msgID, string Status)
        {
            MsgSendOrder order = new MsgSendOrder();

            order.RecordStatus = StatusType.update;
            order.Where        = MsgSendOrder._.ID.In(msgID);
            order.MsgStatus    = Status;
            order.SendTime     = DateTime.Now;
            return(Dal.Submit(order));
        }
Пример #2
0
        public int AddOneMsgToMutilsPerson(string msg, string senderID, string senderName, string senderTel,
                                           string[] reciverIDS, string[] reciverNames, string[] reciverTelPhone)
        {
            List <MsgSendOrder> list = new List <MsgSendOrder>();

            for (int i = 0; i < reciverTelPhone.Length; i++)
            {
                MsgSendOrder order = new MsgSendOrder();
                order.ID          = Guid.NewGuid().ToString();
                order.SenderID    = senderID;
                order.SenderName  = senderName;
                order.SenderTel   = senderTel;
                order.ReciverID   = reciverIDS[i];
                order.ReciverName = reciverNames[i];
                order.ReciverTel  = reciverTelPhone[i];

                order.MsgContent = msg;
                order.MsgStatus  = "待发送";
                order.CreateDate = DateTime.Now;
                list.Add(order);
            }
            SessionFactory dal;
            IDbTransaction tr     = Dal.BeginTransaction(out dal);
            int            result = 0;

            try
            {
                result = dal.SubmitNew(list, ref dal);
                dal.CommitTransaction(tr);
            }
            catch (Exception)
            {
                dal.RollbackTransaction(tr);
                result = -1;
            }
            return(result);
        }