Ejemplo n.º 1
0
        public ResponseBo SaveCheck(WarningCheckBo saveCheckBo)
        {
            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("@WarningModuleTypeId", saveCheckBo.WarningModuleTypeId, DbType.Int32, ParameterDirection.Input);
                    p.Add("@PersonProductId", saveCheckBo.PersonProductId, DbType.Int64, ParameterDirection.Input);
                    p.Add("@CommentId", saveCheckBo.CommentId, DbType.Int64, ParameterDirection.Input);
                    p.Add("@PersonId", saveCheckBo.PersonId, DbType.Int64, ParameterDirection.Input);

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

                    conn.Execute("spWarningSaveCheck", p, commandType: CommandType.StoredProcedure);
                    responseBo.Message   = p.Get <string>("@Message");
                    responseBo.IsSuccess = p.Get <bool>("@IsSuccess");
                }
            }
            catch (Exception ex)
            {
                responseBo = base.SaveExLog(ex, this.GetType(), MethodBase.GetCurrentMethod().Name, saveCheckBo);
            }

            return(responseBo);
        }
Ejemplo n.º 2
0
        public ResponseDto SaveCheck(WarningCheckDto saveCheckDto)
        {
            ResponseDto responseDto = new ResponseDto();

            WarningCheckBo saveCheckBo = new WarningCheckBo()
            {
                WarningModuleTypeId = saveCheckDto.WarningModuleTypeId,

                PersonProductId = saveCheckDto.PersonProductId,
                CommentId       = saveCheckDto.CommentId,
                PersonId        = saveCheckDto.PersonId,

                Session = Session
            };

            ResponseBo responseBo = warningBusiness.SaveCheck(saveCheckBo);

            responseDto = responseBo.ToResponseDto();

            return(responseDto);
        }