Пример #1
0
        public ResponseDto Seen(NotificationSeenDto seenDto)
        {
            NotificationSeenBo seenBo = new NotificationSeenBo()
            {
                MyPersonId         = seenDto.MyPersonId,
                NotificationIdList = seenDto.NotificationIdList,

                Session = Session
            };

            ResponseBo responseBo = notificationBusiness.Seen(seenBo);

            base.SendNotifyWsToList(responseBo.PersonNotifyList);

            return(responseBo.ToResponseDto());
        }
Пример #2
0
        public ResponseBo Seen(NotificationSeenBo seenBo)
        {
            ResponseBo responseBo = new ResponseBo();

            try
            {
                using (SqlConnection conn = DbAccess.Connection.GetConn())
                {
                    var p = new DynamicParameters();
                    p.Add("@Message", dbType: DbType.String, direction: ParameterDirection.Output, size: 255);
                    p.Add("@IsSuccess", dbType: DbType.Boolean, direction: ParameterDirection.Output);
                    p.Add("@NotifyPersonListJson", dbType: DbType.String, direction: ParameterDirection.Output, size: 1000);

                    p.Add("@MyPersonId", seenBo.MyPersonId, DbType.Int64, ParameterDirection.Input);
                    p.Add("@NotificationIdList", seenBo.NotificationIdList.ToStrSeparated(), DbType.String, ParameterDirection.Input, 4000);

                    p.Add("@OperatorRealId", seenBo.Session.RealPerson.Id, DbType.Int64, ParameterDirection.Input);
                    p.Add("@LanguageId", seenBo.Session.RealPerson.LanguageId, DbType.Int32, ParameterDirection.Input);

                    conn.Execute("spNotificationSeen", p, commandType: CommandType.StoredProcedure);
                    responseBo.Message   = p.Get <string>("@Message");
                    responseBo.IsSuccess = p.Get <bool>("@IsSuccess");

                    string NotifyPersonListJson = p.Get <string>("@NotifyPersonListJson");
                    if (NotifyPersonListJson.IsNotNull())
                    {
                        responseBo.PersonNotifyList = JsonConvert.DeserializeObject <List <PersonNotifyListBo> >(NotifyPersonListJson);
                    }
                }
            }
            catch (Exception ex)
            {
                responseBo = base.SaveExLog(ex, this.GetType(), MethodBase.GetCurrentMethod().Name, seenBo);
            }

            return(responseBo);
        }