using Central.Control.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MES.Production.Service.ServiceImp
{
    /// <summary>
    /// 消息接口Service实现类
    /// Liuzq 2015-11-17
    /// </summary>
    public class MsgRevManage : RepositoryBase<SYS_MSGREV>, IService.IMsgRevManage
    {
        /// <summary>
        /// 功能描述:保存接收人信息  
        /// liuzq 2015-11-17
        public bool SaveOrgPerson(string strMsgID, string strManagerIDJoin)
        {
            try
            {
                //保存接收人
                foreach (var item in strManagerIDJoin.Split(',').Cast<int>().ToList().Select(p => new SYS_MSGREV()
                {
                    MSGID =int.Parse(strMsgID),
                    USERID = p,
                    READSTATUS = 0
                }))
                {
                    this.dbSet.Add(item);
                }
                this.Context.SaveChanges();
                return true;
            }
            catch (Exception e) { throw e; }
        }
    }
}