public ResponseBo UpdateQuantity(BasketProductQuantityUpdateBo updateBo)
        {
            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("@BasketProductId", updateBo.BasketProductId, DbType.Int64, ParameterDirection.Input);
                    p.Add("@Quantity", updateBo.Quantity, DbType.Decimal, ParameterDirection.Input);

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

                    conn.Execute("spBasketProductQuantityUpdate", 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, updateBo);
            }

            return(responseBo);
        }
Beispiel #2
0
        public ResponseDto UpdateQuantity(BasketProductQuantityUpdateDto updateDto)
        {
            ResponseDto responseDto = new ResponseDto();

            BasketProductQuantityUpdateBo updateBo = new BasketProductQuantityUpdateBo()
            {
                BasketProductId = updateDto.BasketProductId,
                Quantity        = updateDto.Quantity,

                Session = Session
            };

            ResponseBo responseBo = basketProductBusiness.UpdateQuantity(updateBo);

            responseDto = responseBo.ToResponseDto();

            return(responseDto);
        }